diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 29cf79b0db6f..3bd6c0cfa30f 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -340,6 +340,7 @@ com.azure.resourcemanager:azure-resourcemanager-securityinsights;1.0.0-beta.2;1. com.azure.resourcemanager:azure-resourcemanager-oep;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-dnsresolver;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-mobilenetwork;1.0.0-beta.2;1.0.0-beta.3 +com.azure.resourcemanager:azure-resourcemanager-containerregistry-generated;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/CHANGELOG.md b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/CHANGELOG.md new file mode 100644 index 000000000000..f54ec479b5ba --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-03-25) + +- Azure Resource Manager ContainerRegistry client library for Java. This package contains Microsoft Azure SDK for ContainerRegistry Management SDK. Package tag package-preview-2022-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/README.md b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/README.md new file mode 100644 index 000000000000..7f90e548a878 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager ContainerRegistry client library for Java + +Azure Resource Manager ContainerRegistry client library for Java. + +This package contains Microsoft Azure SDK for ContainerRegistry Management SDK. Package tag package-preview-2022-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-containerregistry-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-containerregistry-generated + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ContainerRegistryManager manager = ContainerRegistryManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/SAMPLE.md b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/SAMPLE.md new file mode 100644 index 000000000000..e9aa0214f5f8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/SAMPLE.md @@ -0,0 +1,1933 @@ +# Code snippets and samples + + +## ConnectedRegistries + +- [Create](#connectedregistries_create) +- [Deactivate](#connectedregistries_deactivate) +- [Delete](#connectedregistries_delete) +- [Get](#connectedregistries_get) +- [List](#connectedregistries_list) +- [Update](#connectedregistries_update) + +## ExportPipelines + +- [Create](#exportpipelines_create) +- [Delete](#exportpipelines_delete) +- [Get](#exportpipelines_get) +- [List](#exportpipelines_list) + +## ImportPipelines + +- [Create](#importpipelines_create) +- [Delete](#importpipelines_delete) +- [Get](#importpipelines_get) +- [List](#importpipelines_list) + +## Operations + +- [List](#operations_list) + +## PipelineRuns + +- [Create](#pipelineruns_create) +- [Delete](#pipelineruns_delete) +- [Get](#pipelineruns_get) +- [List](#pipelineruns_list) + +## PrivateEndpointConnections + +- [CreateOrUpdate](#privateendpointconnections_createorupdate) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) + +## Registries + +- [CheckNameAvailability](#registries_checknameavailability) +- [Create](#registries_create) +- [Delete](#registries_delete) +- [GenerateCredentials](#registries_generatecredentials) +- [GetByResourceGroup](#registries_getbyresourcegroup) +- [GetPrivateLinkResource](#registries_getprivatelinkresource) +- [ImportImage](#registries_importimage) +- [List](#registries_list) +- [ListByResourceGroup](#registries_listbyresourcegroup) +- [ListCredentials](#registries_listcredentials) +- [ListPrivateLinkResources](#registries_listprivatelinkresources) +- [ListUsages](#registries_listusages) +- [RegenerateCredential](#registries_regeneratecredential) +- [Update](#registries_update) + +## Replications + +- [Create](#replications_create) +- [Delete](#replications_delete) +- [Get](#replications_get) +- [List](#replications_list) +- [Update](#replications_update) + +## ScopeMaps + +- [Create](#scopemaps_create) +- [Delete](#scopemaps_delete) +- [Get](#scopemaps_get) +- [List](#scopemaps_list) +- [Update](#scopemaps_update) + +## Tokens + +- [Create](#tokens_create) +- [Delete](#tokens_delete) +- [Get](#tokens_get) +- [List](#tokens_list) +- [Update](#tokens_update) + +## Webhooks + +- [Create](#webhooks_create) +- [Delete](#webhooks_delete) +- [Get](#webhooks_get) +- [GetCallbackConfig](#webhooks_getcallbackconfig) +- [List](#webhooks_list) +- [ListEvents](#webhooks_listevents) +- [Ping](#webhooks_ping) +- [Update](#webhooks_update) +### ConnectedRegistries_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryMode; +import com.azure.resourcemanager.containerregistry.generated.models.ParentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SyncProperties; +import java.time.Duration; +import java.util.Arrays; + +/** Samples for ConnectedRegistries Create. */ +public final class ConnectedRegistriesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ConnectedRegistryCreate.json + */ + /** + * Sample code: ConnectedRegistryCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .connectedRegistries() + .define("myConnectedRegistry") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withMode(ConnectedRegistryMode.READ_WRITE) + .withParent( + new ParentProperties() + .withSyncProperties( + new SyncProperties() + .withTokenId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken") + .withSchedule("0 9 * * *") + .withSyncWindow(Duration.parse("PT3H")) + .withMessageTtl(Duration.parse("P2D")))) + .withClientTokenIds( + Arrays + .asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token")) + .withNotificationsList(Arrays.asList("hello-world:*:*", "sample/repo/*:1.0:*")) + .create(); + } +} +``` + +### ConnectedRegistries_Deactivate + +```java +import com.azure.core.util.Context; + +/** Samples for ConnectedRegistries Deactivate. */ +public final class ConnectedRegistriesDeactivateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ConnectedRegistryDeactivate.json + */ + /** + * Sample code: ConnectedRegistryDeactivate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryDeactivate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.connectedRegistries().deactivate("myResourceGroup", "myRegistry", "myConnectedRegistry", Context.NONE); + } +} +``` + +### ConnectedRegistries_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ConnectedRegistries Delete. */ +public final class ConnectedRegistriesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ConnectedRegistryDelete.json + */ + /** + * Sample code: ConnectedRegistryDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.connectedRegistries().delete("myResourceGroup", "myRegistry", "myConnectedRegistry", Context.NONE); + } +} +``` + +### ConnectedRegistries_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ConnectedRegistries Get. */ +public final class ConnectedRegistriesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ConnectedRegistryGet.json + */ + /** + * Sample code: ConnectedRegistryGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .connectedRegistries() + .getWithResponse("myResourceGroup", "myRegistry", "myConnectedRegistry", Context.NONE); + } +} +``` + +### ConnectedRegistries_List + +```java +import com.azure.core.util.Context; + +/** Samples for ConnectedRegistries List. */ +public final class ConnectedRegistriesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ConnectedRegistryList.json + */ + /** + * Sample code: ConnectedRegistryList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.connectedRegistries().list("myResourceGroup", "myRegistry", null, Context.NONE); + } +} +``` + +### ConnectedRegistries_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.AuditLogStatus; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistry; +import com.azure.resourcemanager.containerregistry.generated.models.LogLevel; +import com.azure.resourcemanager.containerregistry.generated.models.LoggingProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SyncUpdateProperties; +import java.time.Duration; +import java.util.Arrays; + +/** Samples for ConnectedRegistries Update. */ +public final class ConnectedRegistriesUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ConnectedRegistryUpdate.json + */ + /** + * Sample code: ConnectedRegistryUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + ConnectedRegistry resource = + manager + .connectedRegistries() + .getWithResponse("myResourceGroup", "myRegistry", "myScopeMap", Context.NONE) + .getValue(); + resource + .update() + .withSyncProperties( + new SyncUpdateProperties() + .withSchedule("0 0 */10 * *") + .withSyncWindow(Duration.parse("P2D")) + .withMessageTtl(Duration.parse("P30D"))) + .withLogging( + new LoggingProperties().withLogLevel(LogLevel.DEBUG).withAuditLogStatus(AuditLogStatus.ENABLED)) + .withClientTokenIds( + Arrays + .asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client2Token")) + .withNotificationsList(Arrays.asList("hello-world:*:*", "sample/repo/*:1.0:*")) + .apply(); + } +} +``` + +### ExportPipelines_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipelineTargetProperties; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineOptions; +import com.azure.resourcemanager.containerregistry.generated.models.ResourceIdentityType; +import java.util.Arrays; + +/** Samples for ExportPipelines Create. */ +public final class ExportPipelinesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ExportPipelineCreate.json + */ + /** + * Sample code: ExportPipelineCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .exportPipelines() + .define("myExportPipeline") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRegion("westus") + .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withTarget( + new ExportPipelineTargetProperties() + .withType("AzureStorageBlobContainer") + .withUri("https://accountname.blob.core.windows.net/containername") + .withKeyVaultUri("https://myvault.vault.azure.net/secrets/acrexportsas")) + .withOptions(Arrays.asList(PipelineOptions.OVERWRITE_BLOBS)) + .create(); + } +} +``` + +### ExportPipelines_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ExportPipelines Delete. */ +public final class ExportPipelinesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ExportPipelineDelete.json + */ + /** + * Sample code: ExportPipelineDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.exportPipelines().delete("myResourceGroup", "myRegistry", "myExportPipeline", Context.NONE); + } +} +``` + +### ExportPipelines_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ExportPipelines Get. */ +public final class ExportPipelinesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ExportPipelineGet.json + */ + /** + * Sample code: ExportPipelineGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.exportPipelines().getWithResponse("myResourceGroup", "myRegistry", "myExportPipeline", Context.NONE); + } +} +``` + +### ExportPipelines_List + +```java +import com.azure.core.util.Context; + +/** Samples for ExportPipelines List. */ +public final class ExportPipelinesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ExportPipelineList.json + */ + /** + * Sample code: ExportPipelineList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.exportPipelines().list("myResourceGroup", "myRegistry", Context.NONE); + } +} +``` + +### ImportPipelines_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipelineSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineOptions; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineSourceType; +import com.azure.resourcemanager.containerregistry.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.containerregistry.generated.models.UserIdentityProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ImportPipelines Create. */ +public final class ImportPipelinesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ImportPipelineCreate.json + */ + /** + * Sample code: ImportPipelineCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .importPipelines() + .define("myImportPipeline") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRegion("westus") + .withIdentity( + new IdentityProperties() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", + new UserIdentityProperties()))) + .withSource( + new ImportPipelineSourceProperties() + .withType(PipelineSourceType.AZURE_STORAGE_BLOB_CONTAINER) + .withUri("https://accountname.blob.core.windows.net/containername") + .withKeyVaultUri("https://myvault.vault.azure.net/secrets/acrimportsas")) + .withOptions( + Arrays + .asList( + PipelineOptions.OVERWRITE_TAGS, + PipelineOptions.DELETE_SOURCE_BLOB_ON_SUCCESS, + PipelineOptions.CONTINUE_ON_ERRORS)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ImportPipelines_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ImportPipelines Delete. */ +public final class ImportPipelinesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ImportPipelineDelete.json + */ + /** + * Sample code: ImportPipelineDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.importPipelines().delete("myResourceGroup", "myRegistry", "myImportPipeline", Context.NONE); + } +} +``` + +### ImportPipelines_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ImportPipelines Get. */ +public final class ImportPipelinesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ImportPipelineGet.json + */ + /** + * Sample code: ImportPipelineGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.importPipelines().getWithResponse("myResourceGroup", "myRegistry", "myImportPipeline", Context.NONE); + } +} +``` + +### ImportPipelines_List + +```java +import com.azure.core.util.Context; + +/** Samples for ImportPipelines List. */ +public final class ImportPipelinesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ImportPipelineList.json + */ + /** + * Sample code: ImportPipelineList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.importPipelines().list("myResourceGroup", "myRegistry", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/OperationList.json + */ + /** + * Sample code: OperationList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void operationList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PipelineRuns_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunSourceType; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunTargetProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunTargetType; +import java.util.Arrays; + +/** Samples for PipelineRuns Create. */ +public final class PipelineRunsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PipelineRunCreate_Import.json + */ + /** + * Sample code: PipelineRunCreate_Import. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunCreateImport( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .pipelineRuns() + .define("myPipelineRun") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRequest( + new PipelineRunRequest() + .withPipelineResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline") + .withSource( + new PipelineRunSourceProperties() + .withType(PipelineRunSourceType.AZURE_STORAGE_BLOB) + .withName("myblob.tar.gz")) + .withCatalogDigest("sha256@")) + .withForceUpdateTag("2020-03-04T17:23:21.9261521+00:00") + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PipelineRunCreate_Export.json + */ + /** + * Sample code: PipelineRunCreate_Export. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunCreateExport( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .pipelineRuns() + .define("myPipelineRun") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRequest( + new PipelineRunRequest() + .withPipelineResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline") + .withArtifacts( + Arrays + .asList( + "sourceRepository/hello-world", + "sourceRepository2@sha256:00000000000000000000000000000000000")) + .withTarget( + new PipelineRunTargetProperties() + .withType(PipelineRunTargetType.AZURE_STORAGE_BLOB) + .withName("myblob.tar.gz"))) + .create(); + } +} +``` + +### PipelineRuns_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PipelineRuns Delete. */ +public final class PipelineRunsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PipelineRunDelete.json + */ + /** + * Sample code: PipelineRunDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.pipelineRuns().delete("myResourceGroup", "myRegistry", "myPipelineRun", Context.NONE); + } +} +``` + +### PipelineRuns_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PipelineRuns Get. */ +public final class PipelineRunsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PipelineRunGet.json + */ + /** + * Sample code: PipelineRunGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.pipelineRuns().getWithResponse("myResourceGroup", "myRegistry", "myPipelineRun", Context.NONE); + } +} +``` + +### PipelineRuns_List + +```java +import com.azure.core.util.Context; + +/** Samples for PipelineRuns List. */ +public final class PipelineRunsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PipelineRunList.json + */ + /** + * Sample code: PipelineRunList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.pipelineRuns().list("myResourceGroup", "myRegistry", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.containerregistry.generated.models.ConnectionStatus; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PrivateEndpointConnectionCreateOrUpdate.json + */ + /** + * Sample code: PrivateEndpointConnectionCreateOrUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionCreateOrUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .privateEndpointConnections() + .define("myConnection") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(ConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: PrivateEndpointConnectionDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.privateEndpointConnections().delete("myResourceGroup", "myRegistry", "myConnection", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: PrivateEndpointConnectionGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("myResourceGroup", "myRegistry", "myConnection", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PrivateEndpointConnectionList.json + */ + /** + * Sample code: PrivateEndpointConnectionList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.privateEndpointConnections().list("myResourceGroup", "myRegistry", Context.NONE); + } +} +``` + +### Registries_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryNameCheckRequest; + +/** Samples for Registries CheckNameAvailability. */ +public final class RegistriesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryCheckNameAvailable.json + */ + /** + * Sample code: RegistryCheckNameAvailable. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCheckNameAvailable( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .checkNameAvailabilityWithResponse(new RegistryNameCheckRequest().withName("myRegistry"), Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryCheckNameNotAvailable.json + */ + /** + * Sample code: RegistryCheckNameNotAvailable. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCheckNameNotAvailable( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .checkNameAvailabilityWithResponse(new RegistryNameCheckRequest().withName("myRegistry"), Context.NONE); + } +} +``` + +### Registries_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.Sku; +import com.azure.resourcemanager.containerregistry.generated.models.SkuName; +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries Create. */ +public final class RegistriesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryCreateZoneRedundant.json + */ + /** + * Sample code: RegistryCreateZoneRedundant. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCreateZoneRedundant( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .define("myRegistry") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName(SkuName.STANDARD)) + .withTags(mapOf("key", "value")) + .withZoneRedundancy(ZoneRedundancy.ENABLED) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryCreate.json + */ + /** + * Sample code: RegistryCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .define("myRegistry") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName(SkuName.STANDARD)) + .withTags(mapOf("key", "value")) + .withAdminUserEnabled(true) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Registries_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Registries Delete. */ +public final class RegistriesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryDelete.json + */ + /** + * Sample code: RegistryDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().delete("myResourceGroup", "myRegistry", Context.NONE); + } +} +``` + +### Registries_GenerateCredentials + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsParameters; +import java.time.OffsetDateTime; + +/** Samples for Registries GenerateCredentials. */ +public final class RegistriesGenerateCredentialsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryGenerateCredentials.json + */ + /** + * Sample code: RegistryGenerateCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryGenerateCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .generateCredentials( + "myResourceGroup", + "myRegistry", + new GenerateCredentialsParameters() + .withTokenId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken") + .withExpiry(OffsetDateTime.parse("2020-12-31T15:59:59.0707808Z")), + Context.NONE); + } +} +``` + +### Registries_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Registries GetByResourceGroup. */ +public final class RegistriesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryGet.json + */ + /** + * Sample code: RegistryGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().getByResourceGroupWithResponse("myResourceGroup", "myRegistry", Context.NONE); + } +} +``` + +### Registries_GetPrivateLinkResource + +```java +import com.azure.core.util.Context; + +/** Samples for Registries GetPrivateLinkResource. */ +public final class RegistriesGetPrivateLinkResourceSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryGetPrivateLinkResource.json + */ + /** + * Sample code: RegistryGetPrivateLinkResource. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryGetPrivateLinkResource( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .getPrivateLinkResourceWithResponse("myResourceGroup", "myRegistry", "registry", Context.NONE); + } +} +``` + +### Registries_ImportImage + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.ImportImageParameters; +import com.azure.resourcemanager.containerregistry.generated.models.ImportMode; +import com.azure.resourcemanager.containerregistry.generated.models.ImportSource; +import java.util.Arrays; + +/** Samples for Registries ImportImage. */ +public final class RegistriesImportImageSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ImportImageFromPublicRegistry.json + */ + /** + * Sample code: ImportImageFromPublicRegistry. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importImageFromPublicRegistry( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .importImage( + "myResourceGroup", + "myRegistry", + new ImportImageParameters() + .withSource( + new ImportSource() + .withRegistryUri("registry.hub.docker.com") + .withSourceImage("library/hello-world")) + .withTargetTags(Arrays.asList("targetRepository:targetTag")) + .withUntaggedTargetRepositories(Arrays.asList("targetRepository1")) + .withMode(ImportMode.FORCE), + Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ImportImageByTag.json + */ + /** + * Sample code: ImportImageByTag. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importImageByTag( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .importImage( + "myResourceGroup", + "myRegistry", + new ImportImageParameters() + .withSource( + new ImportSource() + .withResourceId( + "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry") + .withSourceImage("sourceRepository:sourceTag")) + .withTargetTags(Arrays.asList("targetRepository:targetTag")) + .withUntaggedTargetRepositories(Arrays.asList("targetRepository1")) + .withMode(ImportMode.FORCE), + Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ImportImageByManifestDigest.json + */ + /** + * Sample code: ImportImageByManifestDigest. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importImageByManifestDigest( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .importImage( + "myResourceGroup", + "myRegistry", + new ImportImageParameters() + .withSource( + new ImportSource() + .withResourceId( + "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry") + .withSourceImage( + "sourceRepository@sha256:0000000000000000000000000000000000000000000000000000000000000000")) + .withTargetTags(Arrays.asList("targetRepository:targetTag")) + .withUntaggedTargetRepositories(Arrays.asList("targetRepository1")) + .withMode(ImportMode.FORCE), + Context.NONE); + } +} +``` + +### Registries_List + +```java +import com.azure.core.util.Context; + +/** Samples for Registries List. */ +public final class RegistriesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryList.json + */ + /** + * Sample code: RegistryList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().list(Context.NONE); + } +} +``` + +### Registries_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Registries ListByResourceGroup. */ +public final class RegistriesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryListByResourceGroup.json + */ + /** + * Sample code: RegistryListByResourceGroup. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListByResourceGroup( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().listByResourceGroup("myResourceGroup", Context.NONE); + } +} +``` + +### Registries_ListCredentials + +```java +import com.azure.core.util.Context; + +/** Samples for Registries ListCredentials. */ +public final class RegistriesListCredentialsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryListCredentials.json + */ + /** + * Sample code: RegistryListCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().listCredentialsWithResponse("myResourceGroup", "myRegistry", Context.NONE); + } +} +``` + +### Registries_ListPrivateLinkResources + +```java +import com.azure.core.util.Context; + +/** Samples for Registries ListPrivateLinkResources. */ +public final class RegistriesListPrivateLinkResourcesSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryListPrivateLinkResources.json + */ + /** + * Sample code: RegistryListPrivateLinkResources. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListPrivateLinkResources( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().listPrivateLinkResources("myResourceGroup", "myRegistry", Context.NONE); + } +} +``` + +### Registries_ListUsages + +```java +import com.azure.core.util.Context; + +/** Samples for Registries ListUsages. */ +public final class RegistriesListUsagesSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryListUsages.json + */ + /** + * Sample code: RegistryListUsages. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListUsages( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().listUsagesWithResponse("myResourceGroup", "myRegistry", Context.NONE); + } +} +``` + +### Registries_RegenerateCredential + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.PasswordName; +import com.azure.resourcemanager.containerregistry.generated.models.RegenerateCredentialParameters; + +/** Samples for Registries RegenerateCredential. */ +public final class RegistriesRegenerateCredentialSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryRegenerateCredential.json + */ + /** + * Sample code: RegistryRegenerateCredential. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryRegenerateCredential( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .regenerateCredentialWithResponse( + "myResourceGroup", + "myRegistry", + new RegenerateCredentialParameters().withName(PasswordName.PASSWORD), + Context.NONE); + } +} +``` + +### Registries_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.Registry; +import com.azure.resourcemanager.containerregistry.generated.models.Sku; +import com.azure.resourcemanager.containerregistry.generated.models.SkuName; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries Update. */ +public final class RegistriesUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryUpdate.json + */ + /** + * Sample code: RegistryUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Registry resource = + manager + .registries() + .getByResourceGroupWithResponse("myResourceGroup", "myRegistry", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key", "value")) + .withSku(new Sku().withName(SkuName.STANDARD)) + .withAdminUserEnabled(true) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Replications_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Replications Create. */ +public final class ReplicationsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ReplicationCreate.json + */ + /** + * Sample code: ReplicationCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .replications() + .define("myReplication") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("key", "value")) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ReplicationCreateZoneRedundant.json + */ + /** + * Sample code: ReplicationCreateZoneRedundant. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationCreateZoneRedundant( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .replications() + .define("myReplication") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("key", "value")) + .withRegionEndpointEnabled(true) + .withZoneRedundancy(ZoneRedundancy.ENABLED) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Replications_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Replications Delete. */ +public final class ReplicationsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ReplicationDelete.json + */ + /** + * Sample code: ReplicationDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.replications().delete("myResourceGroup", "myRegistry", "myReplication", Context.NONE); + } +} +``` + +### Replications_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Replications Get. */ +public final class ReplicationsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ReplicationGet.json + */ + /** + * Sample code: ReplicationGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.replications().getWithResponse("myResourceGroup", "myRegistry", "myReplication", Context.NONE); + } +} +``` + +### Replications_List + +```java +import com.azure.core.util.Context; + +/** Samples for Replications List. */ +public final class ReplicationsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ReplicationList.json + */ + /** + * Sample code: ReplicationList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.replications().list("myResourceGroup", "myRegistry", Context.NONE); + } +} +``` + +### Replications_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.Replication; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Replications Update. */ +public final class ReplicationsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ReplicationUpdate.json + */ + /** + * Sample code: ReplicationUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Replication resource = + manager + .replications() + .getWithResponse("myResourceGroup", "myRegistry", "myReplication", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key", "value")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ScopeMaps_Create + +```java +import java.util.Arrays; + +/** Samples for ScopeMaps Create. */ +public final class ScopeMapsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ScopeMapCreate.json + */ + /** + * Sample code: ScopeMapCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .scopeMaps() + .define("myScopeMap") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withDescription("Developer Scopes") + .withActions(Arrays.asList("repositories/myrepository/contentWrite", "repositories/myrepository/delete")) + .create(); + } +} +``` + +### ScopeMaps_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeMaps Delete. */ +public final class ScopeMapsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ScopeMapDelete.json + */ + /** + * Sample code: ScopeMapDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.scopeMaps().delete("myResourceGroup", "myRegistry", "myScopeMap", Context.NONE); + } +} +``` + +### ScopeMaps_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeMaps Get. */ +public final class ScopeMapsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ScopeMapGet.json + */ + /** + * Sample code: ScopeMapGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.scopeMaps().getWithResponse("myResourceGroup", "myRegistry", "myScopeMap", Context.NONE); + } +} +``` + +### ScopeMaps_List + +```java +import com.azure.core.util.Context; + +/** Samples for ScopeMaps List. */ +public final class ScopeMapsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ScopeMapList.json + */ + /** + * Sample code: ScopeMapList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.scopeMaps().list("myResourceGroup", "myRegistry", Context.NONE); + } +} +``` + +### ScopeMaps_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMap; +import java.util.Arrays; + +/** Samples for ScopeMaps Update. */ +public final class ScopeMapsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ScopeMapUpdate.json + */ + /** + * Sample code: ScopeMapUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + ScopeMap resource = + manager.scopeMaps().getWithResponse("myResourceGroup", "myRegistry", "myScopeMap", Context.NONE).getValue(); + resource + .update() + .withDescription("Developer Scopes") + .withActions( + Arrays.asList("repositories/myrepository/contentWrite", "repositories/myrepository/contentRead")) + .apply(); + } +} +``` + +### Tokens_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificate; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificateName; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCredentialsProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TokenStatus; +import java.util.Arrays; + +/** Samples for Tokens Create. */ +public final class TokensCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/TokenCreate.json + */ + /** + * Sample code: TokenCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tokens() + .define("myToken") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withScopeMapId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap") + .withCredentials( + new TokenCredentialsProperties() + .withCertificates( + Arrays + .asList( + new TokenCertificate() + .withName(TokenCertificateName.CERTIFICATE1) + .withEncodedPemCertificate( + "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==")))) + .withStatus(TokenStatus.DISABLED) + .create(); + } +} +``` + +### Tokens_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Tokens Delete. */ +public final class TokensDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/TokenDelete.json + */ + /** + * Sample code: TokenDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tokens().delete("myResourceGroup", "myRegistry", "myToken", Context.NONE); + } +} +``` + +### Tokens_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Tokens Get. */ +public final class TokensGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/TokenGet.json + */ + /** + * Sample code: TokenGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tokens().getWithResponse("myResourceGroup", "myRegistry", "myToken", Context.NONE); + } +} +``` + +### Tokens_List + +```java +import com.azure.core.util.Context; + +/** Samples for Tokens List. */ +public final class TokensListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/TokenList.json + */ + /** + * Sample code: TokenList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tokens().list("myResourceGroup", "myRegistry", Context.NONE); + } +} +``` + +### Tokens_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.Token; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificate; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificateName; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCredentialsProperties; +import java.util.Arrays; + +/** Samples for Tokens Update. */ +public final class TokensUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/TokenUpdate.json + */ + /** + * Sample code: TokenUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Token resource = + manager.tokens().getWithResponse("myResourceGroup", "myRegistry", "myToken", Context.NONE).getValue(); + resource + .update() + .withScopeMapId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myNewScopeMap") + .withCredentials( + new TokenCredentialsProperties() + .withCertificates( + Arrays + .asList( + new TokenCertificate() + .withName(TokenCertificateName.CERTIFICATE1) + .withEncodedPemCertificate( + "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==")))) + .apply(); + } +} +``` + +### Webhooks_Create + +```java +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Webhooks Create. */ +public final class WebhooksCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookCreate.json + */ + /** + * Sample code: WebhookCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .webhooks() + .define("myWebhook") + .withRegion("westus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("key", "value")) + .withServiceUri("http://myservice.com") + .withCustomHeaders(mapOf("Authorization", "Basic 000000000000000000000000000000000000000000000000000")) + .withStatus(WebhookStatus.ENABLED) + .withScope("myRepository") + .withActions(Arrays.asList(WebhookAction.PUSH)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Webhooks_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Webhooks Delete. */ +public final class WebhooksDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookDelete.json + */ + /** + * Sample code: WebhookDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().delete("myResourceGroup", "myRegistry", "myWebhook", Context.NONE); + } +} +``` + +### Webhooks_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Webhooks Get. */ +public final class WebhooksGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookGet.json + */ + /** + * Sample code: WebhookGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().getWithResponse("myResourceGroup", "myRegistry", "myWebhook", Context.NONE); + } +} +``` + +### Webhooks_GetCallbackConfig + +```java +import com.azure.core.util.Context; + +/** Samples for Webhooks GetCallbackConfig. */ +public final class WebhooksGetCallbackConfigSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookGetCallbackConfig.json + */ + /** + * Sample code: WebhookGetCallbackConfig. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookGetCallbackConfig( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().getCallbackConfigWithResponse("myResourceGroup", "myRegistry", "myWebhook", Context.NONE); + } +} +``` + +### Webhooks_List + +```java +import com.azure.core.util.Context; + +/** Samples for Webhooks List. */ +public final class WebhooksListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookList.json + */ + /** + * Sample code: WebhookList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().list("myResourceGroup", "myRegistry", Context.NONE); + } +} +``` + +### Webhooks_ListEvents + +```java +import com.azure.core.util.Context; + +/** Samples for Webhooks ListEvents. */ +public final class WebhooksListEventsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookListEvents.json + */ + /** + * Sample code: WebhookListEvents. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookListEvents( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().listEvents("myResourceGroup", "myRegistry", "myWebhook", Context.NONE); + } +} +``` + +### Webhooks_Ping + +```java +import com.azure.core.util.Context; + +/** Samples for Webhooks Ping. */ +public final class WebhooksPingSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookPing.json + */ + /** + * Sample code: WebhookPing. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookPing( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().pingWithResponse("myResourceGroup", "myRegistry", "myWebhook", Context.NONE); + } +} +``` + +### Webhooks_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.Webhook; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Webhooks Update. */ +public final class WebhooksUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookUpdate.json + */ + /** + * Sample code: WebhookUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Webhook resource = + manager.webhooks().getWithResponse("myResourceGroup", "myRegistry", "myWebhook", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("key", "value")) + .withServiceUri("http://myservice.com") + .withCustomHeaders(mapOf("Authorization", "Basic 000000000000000000000000000000000000000000000000000")) + .withStatus(WebhookStatus.ENABLED) + .withScope("myRepository") + .withActions(Arrays.asList(WebhookAction.PUSH)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/pom.xml b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/pom.xml new file mode 100644 index 000000000000..e2f58a8836fb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-containerregistry-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ContainerRegistry Management + This package contains Microsoft Azure SDK for ContainerRegistry Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-preview-2022-02. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.26.0 + + + com.azure + azure-core-management + 1.5.3 + + + diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/ContainerRegistryManager.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/ContainerRegistryManager.java new file mode 100644 index 000000000000..7422f9f365a3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/ContainerRegistryManager.java @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.ContainerRegistryManagementClient; +import com.azure.resourcemanager.containerregistry.generated.implementation.ConnectedRegistriesImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.ContainerRegistryManagementClientBuilder; +import com.azure.resourcemanager.containerregistry.generated.implementation.ExportPipelinesImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.ImportPipelinesImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.PipelineRunsImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.RegistriesImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.ReplicationsImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.ScopeMapsImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.TokensImpl; +import com.azure.resourcemanager.containerregistry.generated.implementation.WebhooksImpl; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistries; +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipelines; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipelines; +import com.azure.resourcemanager.containerregistry.generated.models.Operations; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRuns; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpointConnections; +import com.azure.resourcemanager.containerregistry.generated.models.Registries; +import com.azure.resourcemanager.containerregistry.generated.models.Replications; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMaps; +import com.azure.resourcemanager.containerregistry.generated.models.Tokens; +import com.azure.resourcemanager.containerregistry.generated.models.Webhooks; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to ContainerRegistryManager. */ +public final class ContainerRegistryManager { + private ConnectedRegistries connectedRegistries; + + private ExportPipelines exportPipelines; + + private Registries registries; + + private ImportPipelines importPipelines; + + private Operations operations; + + private PipelineRuns pipelineRuns; + + private PrivateEndpointConnections privateEndpointConnections; + + private Replications replications; + + private ScopeMaps scopeMaps; + + private Tokens tokens; + + private Webhooks webhooks; + + private final ContainerRegistryManagementClient clientObject; + + private ContainerRegistryManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ContainerRegistryManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ContainerRegistry service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ContainerRegistry service API instance. + */ + public static ContainerRegistryManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create ContainerRegistryManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ContainerRegistryManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of ContainerRegistry service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ContainerRegistry service API instance. + */ + public ContainerRegistryManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.containerregistry.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ContainerRegistryManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of ConnectedRegistries. */ + public ConnectedRegistries connectedRegistries() { + if (this.connectedRegistries == null) { + this.connectedRegistries = new ConnectedRegistriesImpl(clientObject.getConnectedRegistries(), this); + } + return connectedRegistries; + } + + /** @return Resource collection API of ExportPipelines. */ + public ExportPipelines exportPipelines() { + if (this.exportPipelines == null) { + this.exportPipelines = new ExportPipelinesImpl(clientObject.getExportPipelines(), this); + } + return exportPipelines; + } + + /** @return Resource collection API of Registries. */ + public Registries registries() { + if (this.registries == null) { + this.registries = new RegistriesImpl(clientObject.getRegistries(), this); + } + return registries; + } + + /** @return Resource collection API of ImportPipelines. */ + public ImportPipelines importPipelines() { + if (this.importPipelines == null) { + this.importPipelines = new ImportPipelinesImpl(clientObject.getImportPipelines(), this); + } + return importPipelines; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of PipelineRuns. */ + public PipelineRuns pipelineRuns() { + if (this.pipelineRuns == null) { + this.pipelineRuns = new PipelineRunsImpl(clientObject.getPipelineRuns(), this); + } + return pipelineRuns; + } + + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** @return Resource collection API of Replications. */ + public Replications replications() { + if (this.replications == null) { + this.replications = new ReplicationsImpl(clientObject.getReplications(), this); + } + return replications; + } + + /** @return Resource collection API of ScopeMaps. */ + public ScopeMaps scopeMaps() { + if (this.scopeMaps == null) { + this.scopeMaps = new ScopeMapsImpl(clientObject.getScopeMaps(), this); + } + return scopeMaps; + } + + /** @return Resource collection API of Tokens. */ + public Tokens tokens() { + if (this.tokens == null) { + this.tokens = new TokensImpl(clientObject.getTokens(), this); + } + return tokens; + } + + /** @return Resource collection API of Webhooks. */ + public Webhooks webhooks() { + if (this.webhooks == null) { + this.webhooks = new WebhooksImpl(clientObject.getWebhooks(), this); + } + return webhooks; + } + + /** + * @return Wrapped service client ContainerRegistryManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public ContainerRegistryManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ConnectedRegistriesClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ConnectedRegistriesClient.java new file mode 100644 index 000000000000..b1a76383ac06 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ConnectedRegistriesClient.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryInner; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ConnectedRegistriesClient. */ +public interface ConnectedRegistriesClient { + /** + * Lists all connected registries for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all connected registries for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter An OData filter expression that describes a subset of connectedRegistries to return. The parameters + * that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and + * connectionState. The supported operator is eq. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String registryName, String filter, Context context); + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedRegistryInner get(String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectedRegistryInner> beginCreate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters); + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectedRegistryInner> beginCreate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters, + Context context); + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedRegistryInner create( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters); + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedRegistryInner create( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters, + Context context); + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectedRegistryInner> beginUpdate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters); + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectedRegistryInner> beginUpdate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + Context context); + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedRegistryInner update( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters); + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectedRegistryInner update( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + Context context); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeactivate( + String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeactivate( + String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deactivate(String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deactivate(String resourceGroupName, String registryName, String connectedRegistryName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ContainerRegistryManagementClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ContainerRegistryManagementClient.java new file mode 100644 index 000000000000..fcf2678ebd83 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ContainerRegistryManagementClient.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ContainerRegistryManagementClient class. */ +public interface ContainerRegistryManagementClient { + /** + * Gets The Microsoft Azure subscription ID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the ConnectedRegistriesClient object to access its operations. + * + * @return the ConnectedRegistriesClient object. + */ + ConnectedRegistriesClient getConnectedRegistries(); + + /** + * Gets the ExportPipelinesClient object to access its operations. + * + * @return the ExportPipelinesClient object. + */ + ExportPipelinesClient getExportPipelines(); + + /** + * Gets the RegistriesClient object to access its operations. + * + * @return the RegistriesClient object. + */ + RegistriesClient getRegistries(); + + /** + * Gets the ImportPipelinesClient object to access its operations. + * + * @return the ImportPipelinesClient object. + */ + ImportPipelinesClient getImportPipelines(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the PipelineRunsClient object to access its operations. + * + * @return the PipelineRunsClient object. + */ + PipelineRunsClient getPipelineRuns(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the ReplicationsClient object to access its operations. + * + * @return the ReplicationsClient object. + */ + ReplicationsClient getReplications(); + + /** + * Gets the ScopeMapsClient object to access its operations. + * + * @return the ScopeMapsClient object. + */ + ScopeMapsClient getScopeMaps(); + + /** + * Gets the TokensClient object to access its operations. + * + * @return the TokensClient object. + */ + TokensClient getTokens(); + + /** + * Gets the WebhooksClient object to access its operations. + * + * @return the WebhooksClient object. + */ + WebhooksClient getWebhooks(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ExportPipelinesClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ExportPipelinesClient.java new file mode 100644 index 000000000000..048b33611ec8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ExportPipelinesClient.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ExportPipelineInner; + +/** An instance of this class provides access to all the operations defined in ExportPipelinesClient. */ +public interface ExportPipelinesClient { + /** + * Lists all export pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all export pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExportPipelineInner get(String resourceGroupName, String registryName, String exportPipelineName); + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String exportPipelineName, Context context); + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters); + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters, + Context context); + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExportPipelineInner create( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters); + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExportPipelineInner create( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters, + Context context); + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String exportPipelineName); + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String exportPipelineName, Context context); + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String exportPipelineName); + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String exportPipelineName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ImportPipelinesClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ImportPipelinesClient.java new file mode 100644 index 000000000000..14acfe04b7cb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ImportPipelinesClient.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ImportPipelineInner; + +/** An instance of this class provides access to all the operations defined in ImportPipelinesClient. */ +public interface ImportPipelinesClient { + /** + * Lists all import pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all import pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImportPipelineInner get(String resourceGroupName, String registryName, String importPipelineName); + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String importPipelineName, Context context); + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents an import pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ImportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters); + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents an import pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ImportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters, + Context context); + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImportPipelineInner create( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters); + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ImportPipelineInner create( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters, + Context context); + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String importPipelineName); + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String importPipelineName, Context context); + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String importPipelineName); + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String importPipelineName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/OperationsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/OperationsClient.java new file mode 100644 index 000000000000..1c30626832d4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.OperationDefinitionInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PipelineRunsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PipelineRunsClient.java new file mode 100644 index 000000000000..c84030c1bac8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PipelineRunsClient.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PipelineRunInner; + +/** An instance of this class provides access to all the operations defined in PipelineRunsClient. */ +public interface PipelineRunsClient { + /** + * Lists all the pipeline runs for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the pipeline runs for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PipelineRunInner get(String resourceGroupName, String registryName, String pipelineRunName); + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String pipelineRunName, Context context); + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PipelineRunInner> beginCreate( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters); + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PipelineRunInner> beginCreate( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters, + Context context); + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PipelineRunInner create( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters); + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PipelineRunInner create( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters, + Context context); + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String pipelineRunName); + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String pipelineRunName, Context context); + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String pipelineRunName); + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String pipelineRunName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PrivateEndpointConnectionsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..9e7faf65982b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String registryName, String privateEndpointConnectionName); + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context); + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a private endpoint connection for a + * container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection); + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a private endpoint connection for a + * container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context); + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection); + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/RegistriesClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/RegistriesClient.java new file mode 100644 index 000000000000..d812344b5e85 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/RegistriesClient.java @@ -0,0 +1,589 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.GenerateCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryListCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryNameStatusInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryUsageListResultInner; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsParameters; +import com.azure.resourcemanager.containerregistry.generated.models.ImportImageParameters; +import com.azure.resourcemanager.containerregistry.generated.models.RegenerateCredentialParameters; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryNameCheckRequest; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryUpdateParameters; + +/** An instance of this class provides access to all the operations defined in RegistriesClient. */ +public interface RegistriesClient { + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginImportImage( + String resourceGroupName, String registryName, ImportImageParameters parameters); + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginImportImage( + String resourceGroupName, String registryName, ImportImageParameters parameters, Context context); + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters); + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters, Context context); + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric + * characters, be globally unique, and between 5 and 50 characters in length. + * + * @param registryNameCheckRequest The object containing information for the availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryNameStatusInner checkNameAvailability(RegistryNameCheckRequest registryNameCheckRequest); + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric + * characters, be globally unique, and between 5 and 50 characters in length. + * + * @param registryNameCheckRequest The object containing information for the availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + RegistryNameCheckRequest registryNameCheckRequest, Context context); + + /** + * Lists all the container registries under the specified subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the container registries under the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner getByResourceGroup(String resourceGroupName, String registryName); + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RegistryInner> beginCreate( + String resourceGroupName, String registryName, RegistryInner registry); + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RegistryInner> beginCreate( + String resourceGroupName, String registryName, RegistryInner registry, Context context); + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner create(String resourceGroupName, String registryName, RegistryInner registry); + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner create(String resourceGroupName, String registryName, RegistryInner registry, Context context); + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName); + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, Context context); + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName); + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, Context context); + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RegistryInner> beginUpdate( + String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters); + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RegistryInner> beginUpdate( + String resourceGroupName, + String registryName, + RegistryUpdateParameters registryUpdateParameters, + Context context); + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner update( + String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters); + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryInner update( + String resourceGroupName, + String registryName, + RegistryUpdateParameters registryUpdateParameters, + Context context); + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryUsageListResultInner listUsages(String resourceGroupName, String registryName); + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listUsagesWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPrivateLinkResources(String resourceGroupName, String registryName); + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPrivateLinkResources( + String resourceGroupName, String registryName, Context context); + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner getPrivateLinkResource(String resourceGroupName, String registryName, String groupName); + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPrivateLinkResourceWithResponse( + String resourceGroupName, String registryName, String groupName, Context context); + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryListCredentialsResultInner listCredentials(String resourceGroupName, String registryName); + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listCredentialsWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegistryListCredentialsResultInner regenerateCredential( + String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateCredentialWithResponse( + String resourceGroupName, + String registryName, + RegenerateCredentialParameters regenerateCredentialParameters, + Context context); + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GenerateCredentialsResultInner> beginGenerateCredentials( + String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters); + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GenerateCredentialsResultInner> beginGenerateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context); + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenerateCredentialsResultInner generateCredentials( + String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters); + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenerateCredentialsResultInner generateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ReplicationsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ReplicationsClient.java new file mode 100644 index 000000000000..dd28d2ca8caa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ReplicationsClient.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ReplicationInner; +import com.azure.resourcemanager.containerregistry.generated.models.ReplicationUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ReplicationsClient. */ +public interface ReplicationsClient { + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationInner get(String resourceGroupName, String registryName, String replicationName); + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String replicationName, Context context); + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationInner> beginCreate( + String resourceGroupName, String registryName, String replicationName, ReplicationInner replication); + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationInner> beginCreate( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationInner replication, + Context context); + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationInner create( + String resourceGroupName, String registryName, String replicationName, ReplicationInner replication); + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationInner create( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationInner replication, + Context context); + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String replicationName); + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String replicationName, Context context); + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String replicationName); + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String replicationName, Context context); + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replicationUpdateParameters The parameters for updating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationInner> beginUpdate( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters); + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replicationUpdateParameters The parameters for updating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ReplicationInner> beginUpdate( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters, + Context context); + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replicationUpdateParameters The parameters for updating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationInner update( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters); + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replicationUpdateParameters The parameters for updating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationInner update( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters, + Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ScopeMapsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ScopeMapsClient.java new file mode 100644 index 000000000000..f89de322de61 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/ScopeMapsClient.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ScopeMapInner; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMapUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ScopeMapsClient. */ +public interface ScopeMapsClient { + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopeMapInner get(String resourceGroupName, String registryName, String scopeMapName); + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String scopeMapName, Context context); + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ScopeMapInner> beginCreate( + String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters); + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ScopeMapInner> beginCreate( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapInner scopeMapCreateParameters, + Context context); + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopeMapInner create( + String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters); + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopeMapInner create( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapInner scopeMapCreateParameters, + Context context); + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String scopeMapName); + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String scopeMapName, Context context); + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String scopeMapName); + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String scopeMapName, Context context); + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ScopeMapInner> beginUpdate( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters); + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ScopeMapInner> beginUpdate( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters, + Context context); + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopeMapInner update( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters); + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ScopeMapInner update( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters, + Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TokensClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TokensClient.java new file mode 100644 index 000000000000..e3c21dd11bea --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/TokensClient.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TokenInner; +import com.azure.resourcemanager.containerregistry.generated.models.TokenUpdateParameters; + +/** An instance of this class provides access to all the operations defined in TokensClient. */ +public interface TokensClient { + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TokenInner get(String resourceGroupName, String registryName, String tokenName); + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String tokenName, Context context); + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TokenInner> beginCreate( + String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters); + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TokenInner> beginCreate( + String resourceGroupName, + String registryName, + String tokenName, + TokenInner tokenCreateParameters, + Context context); + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TokenInner create( + String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters); + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TokenInner create( + String resourceGroupName, + String registryName, + String tokenName, + TokenInner tokenCreateParameters, + Context context); + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String tokenName); + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String tokenName, Context context); + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String tokenName); + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String tokenName, Context context); + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TokenInner> beginUpdate( + String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters); + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TokenInner> beginUpdate( + String resourceGroupName, + String registryName, + String tokenName, + TokenUpdateParameters tokenUpdateParameters, + Context context); + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TokenInner update( + String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters); + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TokenInner update( + String resourceGroupName, + String registryName, + String tokenName, + TokenUpdateParameters tokenUpdateParameters, + Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/WebhooksClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/WebhooksClient.java new file mode 100644 index 000000000000..103df3860a14 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/WebhooksClient.java @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.CallbackConfigInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInfoInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookInner; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookCreateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookUpdateParameters; + +/** An instance of this class provides access to all the operations defined in WebhooksClient. */ +public interface WebhooksClient { + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebhookInner get(String resourceGroupName, String registryName, String webhookName); + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WebhookInner> beginCreate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters); + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WebhookInner> beginCreate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters, + Context context); + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebhookInner create( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters); + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebhookInner create( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters, + Context context); + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String webhookName); + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String webhookName); + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WebhookInner> beginUpdate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters); + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WebhookInner> beginUpdate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters, + Context context); + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebhookInner update( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters); + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WebhookInner update( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters, + Context context); + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventInfoInner ping(String resourceGroupName, String registryName, String webhookName); + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response pingWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listEvents(String resourceGroupName, String registryName, String webhookName); + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listEvents( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CallbackConfigInner getCallbackConfig(String resourceGroupName, String registryName, String webhookName); + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCallbackConfigWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CallbackConfigInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CallbackConfigInner.java new file mode 100644 index 000000000000..8cd11d95b088 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/CallbackConfigInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The configuration of service URI and custom headers for the webhook. */ +@Fluent +public final class CallbackConfigInner { + /* + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "serviceUri", required = true) + private String serviceUri; + + /* + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "customHeaders") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map customHeaders; + + /** + * Get the serviceUri property: The service URI for the webhook to post notifications. + * + * @return the serviceUri value. + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the serviceUri property: The service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set. + * @return the CallbackConfigInner object itself. + */ + public CallbackConfigInner withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get the customHeaders property: Custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value. + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set the customHeaders property: Custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set. + * @return the CallbackConfigInner object itself. + */ + public CallbackConfigInner withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceUri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property serviceUri in model CallbackConfigInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CallbackConfigInner.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryInner.java new file mode 100644 index 000000000000..c2d75351c6b8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryInner.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.models.ActivationProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryMode; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectionState; +import com.azure.resourcemanager.containerregistry.generated.models.LoggingProperties; +import com.azure.resourcemanager.containerregistry.generated.models.LoginServerProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ParentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.StatusDetailProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** An object that represents a connected registry for a container registry. */ +@Fluent +public final class ConnectedRegistryInner extends ProxyResource { + /* + * The properties of the connected registry. + */ + @JsonProperty(value = "properties") + private ConnectedRegistryProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The properties of the connected registry. + * + * @return the innerProperties value. + */ + private ConnectedRegistryProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the mode property: The mode of the connected registry resource that indicates the permissions of the + * registry. + * + * @return the mode value. + */ + public ConnectedRegistryMode mode() { + return this.innerProperties() == null ? null : this.innerProperties().mode(); + } + + /** + * Set the mode property: The mode of the connected registry resource that indicates the permissions of the + * registry. + * + * @param mode the mode value to set. + * @return the ConnectedRegistryInner object itself. + */ + public ConnectedRegistryInner withMode(ConnectedRegistryMode mode) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryProperties(); + } + this.innerProperties().withMode(mode); + return this; + } + + /** + * Get the version property: The current version of ACR runtime on the connected registry. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Get the connectionState property: The current connection state of the connected registry. + * + * @return the connectionState value. + */ + public ConnectionState connectionState() { + return this.innerProperties() == null ? null : this.innerProperties().connectionState(); + } + + /** + * Get the lastActivityTime property: The last activity time of the connected registry. + * + * @return the lastActivityTime value. + */ + public OffsetDateTime lastActivityTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastActivityTime(); + } + + /** + * Get the activation property: The activation properties of the connected registry. + * + * @return the activation value. + */ + public ActivationProperties activation() { + return this.innerProperties() == null ? null : this.innerProperties().activation(); + } + + /** + * Get the parent property: The parent of the connected registry. + * + * @return the parent value. + */ + public ParentProperties parent() { + return this.innerProperties() == null ? null : this.innerProperties().parent(); + } + + /** + * Set the parent property: The parent of the connected registry. + * + * @param parent the parent value to set. + * @return the ConnectedRegistryInner object itself. + */ + public ConnectedRegistryInner withParent(ParentProperties parent) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryProperties(); + } + this.innerProperties().withParent(parent); + return this; + } + + /** + * Get the clientTokenIds property: The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * + * @return the clientTokenIds value. + */ + public List clientTokenIds() { + return this.innerProperties() == null ? null : this.innerProperties().clientTokenIds(); + } + + /** + * Set the clientTokenIds property: The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * + * @param clientTokenIds the clientTokenIds value to set. + * @return the ConnectedRegistryInner object itself. + */ + public ConnectedRegistryInner withClientTokenIds(List clientTokenIds) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryProperties(); + } + this.innerProperties().withClientTokenIds(clientTokenIds); + return this; + } + + /** + * Get the loginServer property: The login server properties of the connected registry. + * + * @return the loginServer value. + */ + public LoginServerProperties loginServer() { + return this.innerProperties() == null ? null : this.innerProperties().loginServer(); + } + + /** + * Set the loginServer property: The login server properties of the connected registry. + * + * @param loginServer the loginServer value to set. + * @return the ConnectedRegistryInner object itself. + */ + public ConnectedRegistryInner withLoginServer(LoginServerProperties loginServer) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryProperties(); + } + this.innerProperties().withLoginServer(loginServer); + return this; + } + + /** + * Get the logging property: The logging properties of the connected registry. + * + * @return the logging value. + */ + public LoggingProperties logging() { + return this.innerProperties() == null ? null : this.innerProperties().logging(); + } + + /** + * Set the logging property: The logging properties of the connected registry. + * + * @param logging the logging value to set. + * @return the ConnectedRegistryInner object itself. + */ + public ConnectedRegistryInner withLogging(LoggingProperties logging) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryProperties(); + } + this.innerProperties().withLogging(logging); + return this; + } + + /** + * Get the statusDetails property: The list of current statuses of the connected registry. + * + * @return the statusDetails value. + */ + public List statusDetails() { + return this.innerProperties() == null ? null : this.innerProperties().statusDetails(); + } + + /** + * Get the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @return the notificationsList value. + */ + public List notificationsList() { + return this.innerProperties() == null ? null : this.innerProperties().notificationsList(); + } + + /** + * Set the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @param notificationsList the notificationsList value to set. + * @return the ConnectedRegistryInner object itself. + */ + public ConnectedRegistryInner withNotificationsList(List notificationsList) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryProperties(); + } + this.innerProperties().withNotificationsList(notificationsList); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryProperties.java new file mode 100644 index 000000000000..a5e54f5f58c3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryProperties.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.ActivationProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryMode; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectionState; +import com.azure.resourcemanager.containerregistry.generated.models.LoggingProperties; +import com.azure.resourcemanager.containerregistry.generated.models.LoginServerProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ParentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.StatusDetailProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The properties of a connected registry. */ +@Fluent +public final class ConnectedRegistryProperties { + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The mode of the connected registry resource that indicates the + * permissions of the registry. + */ + @JsonProperty(value = "mode", required = true) + private ConnectedRegistryMode mode; + + /* + * The current version of ACR runtime on the connected registry. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The current connection state of the connected registry. + */ + @JsonProperty(value = "connectionState", access = JsonProperty.Access.WRITE_ONLY) + private ConnectionState connectionState; + + /* + * The last activity time of the connected registry. + */ + @JsonProperty(value = "lastActivityTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastActivityTime; + + /* + * The activation properties of the connected registry. + */ + @JsonProperty(value = "activation", access = JsonProperty.Access.WRITE_ONLY) + private ActivationProperties activation; + + /* + * The parent of the connected registry. + */ + @JsonProperty(value = "parent", required = true) + private ParentProperties parent; + + /* + * The list of the ACR token resource IDs used to authenticate clients to + * the connected registry. + */ + @JsonProperty(value = "clientTokenIds") + private List clientTokenIds; + + /* + * The login server properties of the connected registry. + */ + @JsonProperty(value = "loginServer") + private LoginServerProperties loginServer; + + /* + * The logging properties of the connected registry. + */ + @JsonProperty(value = "logging") + private LoggingProperties logging; + + /* + * The list of current statuses of the connected registry. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private List statusDetails; + + /* + * The list of notifications subscription information for the connected + * registry. + */ + @JsonProperty(value = "notificationsList") + private List notificationsList; + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the mode property: The mode of the connected registry resource that indicates the permissions of the + * registry. + * + * @return the mode value. + */ + public ConnectedRegistryMode mode() { + return this.mode; + } + + /** + * Set the mode property: The mode of the connected registry resource that indicates the permissions of the + * registry. + * + * @param mode the mode value to set. + * @return the ConnectedRegistryProperties object itself. + */ + public ConnectedRegistryProperties withMode(ConnectedRegistryMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the version property: The current version of ACR runtime on the connected registry. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the connectionState property: The current connection state of the connected registry. + * + * @return the connectionState value. + */ + public ConnectionState connectionState() { + return this.connectionState; + } + + /** + * Get the lastActivityTime property: The last activity time of the connected registry. + * + * @return the lastActivityTime value. + */ + public OffsetDateTime lastActivityTime() { + return this.lastActivityTime; + } + + /** + * Get the activation property: The activation properties of the connected registry. + * + * @return the activation value. + */ + public ActivationProperties activation() { + return this.activation; + } + + /** + * Get the parent property: The parent of the connected registry. + * + * @return the parent value. + */ + public ParentProperties parent() { + return this.parent; + } + + /** + * Set the parent property: The parent of the connected registry. + * + * @param parent the parent value to set. + * @return the ConnectedRegistryProperties object itself. + */ + public ConnectedRegistryProperties withParent(ParentProperties parent) { + this.parent = parent; + return this; + } + + /** + * Get the clientTokenIds property: The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * + * @return the clientTokenIds value. + */ + public List clientTokenIds() { + return this.clientTokenIds; + } + + /** + * Set the clientTokenIds property: The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * + * @param clientTokenIds the clientTokenIds value to set. + * @return the ConnectedRegistryProperties object itself. + */ + public ConnectedRegistryProperties withClientTokenIds(List clientTokenIds) { + this.clientTokenIds = clientTokenIds; + return this; + } + + /** + * Get the loginServer property: The login server properties of the connected registry. + * + * @return the loginServer value. + */ + public LoginServerProperties loginServer() { + return this.loginServer; + } + + /** + * Set the loginServer property: The login server properties of the connected registry. + * + * @param loginServer the loginServer value to set. + * @return the ConnectedRegistryProperties object itself. + */ + public ConnectedRegistryProperties withLoginServer(LoginServerProperties loginServer) { + this.loginServer = loginServer; + return this; + } + + /** + * Get the logging property: The logging properties of the connected registry. + * + * @return the logging value. + */ + public LoggingProperties logging() { + return this.logging; + } + + /** + * Set the logging property: The logging properties of the connected registry. + * + * @param logging the logging value to set. + * @return the ConnectedRegistryProperties object itself. + */ + public ConnectedRegistryProperties withLogging(LoggingProperties logging) { + this.logging = logging; + return this; + } + + /** + * Get the statusDetails property: The list of current statuses of the connected registry. + * + * @return the statusDetails value. + */ + public List statusDetails() { + return this.statusDetails; + } + + /** + * Get the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @return the notificationsList value. + */ + public List notificationsList() { + return this.notificationsList; + } + + /** + * Set the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @param notificationsList the notificationsList value to set. + * @return the ConnectedRegistryProperties object itself. + */ + public ConnectedRegistryProperties withNotificationsList(List notificationsList) { + this.notificationsList = notificationsList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (mode() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property mode in model ConnectedRegistryProperties")); + } + if (activation() != null) { + activation().validate(); + } + if (parent() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property parent in model ConnectedRegistryProperties")); + } else { + parent().validate(); + } + if (loginServer() != null) { + loginServer().validate(); + } + if (logging() != null) { + logging().validate(); + } + if (statusDetails() != null) { + statusDetails().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectedRegistryProperties.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryUpdateProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryUpdateProperties.java new file mode 100644 index 000000000000..b41c3ae91305 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ConnectedRegistryUpdateProperties.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.LoggingProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SyncUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The parameters for updating token properties. */ +@Fluent +public final class ConnectedRegistryUpdateProperties { + /* + * The sync properties of the connected registry with its parent. + */ + @JsonProperty(value = "syncProperties") + private SyncUpdateProperties syncProperties; + + /* + * The logging properties of the connected registry. + */ + @JsonProperty(value = "logging") + private LoggingProperties logging; + + /* + * The list of the ACR token resource IDs used to authenticate clients to + * the connected registry. + */ + @JsonProperty(value = "clientTokenIds") + private List clientTokenIds; + + /* + * The list of notifications subscription information for the connected + * registry. + */ + @JsonProperty(value = "notificationsList") + private List notificationsList; + + /** + * Get the syncProperties property: The sync properties of the connected registry with its parent. + * + * @return the syncProperties value. + */ + public SyncUpdateProperties syncProperties() { + return this.syncProperties; + } + + /** + * Set the syncProperties property: The sync properties of the connected registry with its parent. + * + * @param syncProperties the syncProperties value to set. + * @return the ConnectedRegistryUpdateProperties object itself. + */ + public ConnectedRegistryUpdateProperties withSyncProperties(SyncUpdateProperties syncProperties) { + this.syncProperties = syncProperties; + return this; + } + + /** + * Get the logging property: The logging properties of the connected registry. + * + * @return the logging value. + */ + public LoggingProperties logging() { + return this.logging; + } + + /** + * Set the logging property: The logging properties of the connected registry. + * + * @param logging the logging value to set. + * @return the ConnectedRegistryUpdateProperties object itself. + */ + public ConnectedRegistryUpdateProperties withLogging(LoggingProperties logging) { + this.logging = logging; + return this; + } + + /** + * Get the clientTokenIds property: The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * + * @return the clientTokenIds value. + */ + public List clientTokenIds() { + return this.clientTokenIds; + } + + /** + * Set the clientTokenIds property: The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * + * @param clientTokenIds the clientTokenIds value to set. + * @return the ConnectedRegistryUpdateProperties object itself. + */ + public ConnectedRegistryUpdateProperties withClientTokenIds(List clientTokenIds) { + this.clientTokenIds = clientTokenIds; + return this; + } + + /** + * Get the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @return the notificationsList value. + */ + public List notificationsList() { + return this.notificationsList; + } + + /** + * Set the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @param notificationsList the notificationsList value to set. + * @return the ConnectedRegistryUpdateProperties object itself. + */ + public ConnectedRegistryUpdateProperties withNotificationsList(List notificationsList) { + this.notificationsList = notificationsList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (syncProperties() != null) { + syncProperties().validate(); + } + if (logging() != null) { + logging().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/EventInfoInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/EventInfoInner.java new file mode 100644 index 000000000000..ecc0a364d5e7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/EventInfoInner.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The basic information of an event. */ +@Fluent +public class EventInfoInner { + /* + * The event ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: The event ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The event ID. + * + * @param id the id value to set. + * @return the EventInfoInner object itself. + */ + public EventInfoInner withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/EventInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/EventInner.java new file mode 100644 index 000000000000..ac8c0d888066 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/EventInner.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.EventRequestMessage; +import com.azure.resourcemanager.containerregistry.generated.models.EventResponseMessage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The event for a webhook. */ +@Fluent +public final class EventInner extends EventInfoInner { + /* + * The event request message sent to the service URI. + */ + @JsonProperty(value = "eventRequestMessage") + private EventRequestMessage eventRequestMessage; + + /* + * The event response message received from the service URI. + */ + @JsonProperty(value = "eventResponseMessage") + private EventResponseMessage eventResponseMessage; + + /** + * Get the eventRequestMessage property: The event request message sent to the service URI. + * + * @return the eventRequestMessage value. + */ + public EventRequestMessage eventRequestMessage() { + return this.eventRequestMessage; + } + + /** + * Set the eventRequestMessage property: The event request message sent to the service URI. + * + * @param eventRequestMessage the eventRequestMessage value to set. + * @return the EventInner object itself. + */ + public EventInner withEventRequestMessage(EventRequestMessage eventRequestMessage) { + this.eventRequestMessage = eventRequestMessage; + return this; + } + + /** + * Get the eventResponseMessage property: The event response message received from the service URI. + * + * @return the eventResponseMessage value. + */ + public EventResponseMessage eventResponseMessage() { + return this.eventResponseMessage; + } + + /** + * Set the eventResponseMessage property: The event response message received from the service URI. + * + * @param eventResponseMessage the eventResponseMessage value to set. + * @return the EventInner object itself. + */ + public EventInner withEventResponseMessage(EventResponseMessage eventResponseMessage) { + this.eventResponseMessage = eventResponseMessage; + return this; + } + + /** {@inheritDoc} */ + @Override + public EventInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (eventRequestMessage() != null) { + eventRequestMessage().validate(); + } + if (eventResponseMessage() != null) { + eventResponseMessage().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ExportPipelineInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ExportPipelineInner.java new file mode 100644 index 000000000000..64831181f39b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ExportPipelineInner.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipelineTargetProperties; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineOptions; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An object that represents an export pipeline for a container registry. */ +@Fluent +public final class ExportPipelineInner extends ProxyResource { + /* + * The location of the export pipeline. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The identity of the export pipeline. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The properties of the export pipeline. + */ + @JsonProperty(value = "properties") + private ExportPipelineProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the location property: The location of the export pipeline. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the export pipeline. + * + * @param location the location value to set. + * @return the ExportPipelineInner object itself. + */ + public ExportPipelineInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the identity property: The identity of the export pipeline. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the export pipeline. + * + * @param identity the identity value to set. + * @return the ExportPipelineInner object itself. + */ + public ExportPipelineInner withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The properties of the export pipeline. + * + * @return the innerProperties value. + */ + private ExportPipelineProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the target property: The target properties of the export pipeline. + * + * @return the target value. + */ + public ExportPipelineTargetProperties target() { + return this.innerProperties() == null ? null : this.innerProperties().target(); + } + + /** + * Set the target property: The target properties of the export pipeline. + * + * @param target the target value to set. + * @return the ExportPipelineInner object itself. + */ + public ExportPipelineInner withTarget(ExportPipelineTargetProperties target) { + if (this.innerProperties() == null) { + this.innerProperties = new ExportPipelineProperties(); + } + this.innerProperties().withTarget(target); + return this; + } + + /** + * Get the options property: The list of all options configured for the pipeline. + * + * @return the options value. + */ + public List options() { + return this.innerProperties() == null ? null : this.innerProperties().options(); + } + + /** + * Set the options property: The list of all options configured for the pipeline. + * + * @param options the options value to set. + * @return the ExportPipelineInner object itself. + */ + public ExportPipelineInner withOptions(List options) { + if (this.innerProperties() == null) { + this.innerProperties = new ExportPipelineProperties(); + } + this.innerProperties().withOptions(options); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the pipeline at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ExportPipelineProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ExportPipelineProperties.java new file mode 100644 index 000000000000..003f624b7f91 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ExportPipelineProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipelineTargetProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineOptions; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of an export pipeline. */ +@Fluent +public final class ExportPipelineProperties { + /* + * The target properties of the export pipeline. + */ + @JsonProperty(value = "target", required = true) + private ExportPipelineTargetProperties target; + + /* + * The list of all options configured for the pipeline. + */ + @JsonProperty(value = "options") + private List options; + + /* + * The provisioning state of the pipeline at the time the operation was + * called. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the target property: The target properties of the export pipeline. + * + * @return the target value. + */ + public ExportPipelineTargetProperties target() { + return this.target; + } + + /** + * Set the target property: The target properties of the export pipeline. + * + * @param target the target value to set. + * @return the ExportPipelineProperties object itself. + */ + public ExportPipelineProperties withTarget(ExportPipelineTargetProperties target) { + this.target = target; + return this; + } + + /** + * Get the options property: The list of all options configured for the pipeline. + * + * @return the options value. + */ + public List options() { + return this.options; + } + + /** + * Set the options property: The list of all options configured for the pipeline. + * + * @param options the options value to set. + * @return the ExportPipelineProperties object itself. + */ + public ExportPipelineProperties withOptions(List options) { + this.options = options; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the pipeline at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (target() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property target in model ExportPipelineProperties")); + } else { + target().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExportPipelineProperties.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/GenerateCredentialsResultInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/GenerateCredentialsResultInner.java new file mode 100644 index 000000000000..6f18f2b420e0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/GenerateCredentialsResultInner.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.TokenPassword; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the GenerateCredentials operation. */ +@Fluent +public final class GenerateCredentialsResultInner { + /* + * The username for a container registry. + */ + @JsonProperty(value = "username") + private String username; + + /* + * The list of passwords for a container registry. + */ + @JsonProperty(value = "passwords") + private List passwords; + + /** + * Get the username property: The username for a container registry. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username for a container registry. + * + * @param username the username value to set. + * @return the GenerateCredentialsResultInner object itself. + */ + public GenerateCredentialsResultInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the passwords property: The list of passwords for a container registry. + * + * @return the passwords value. + */ + public List passwords() { + return this.passwords; + } + + /** + * Set the passwords property: The list of passwords for a container registry. + * + * @param passwords the passwords value to set. + * @return the GenerateCredentialsResultInner object itself. + */ + public GenerateCredentialsResultInner withPasswords(List passwords) { + this.passwords = passwords; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (passwords() != null) { + passwords().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ImportPipelineInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ImportPipelineInner.java new file mode 100644 index 000000000000..b84c1347a48e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ImportPipelineInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipelineSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineOptions; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineTriggerProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An object that represents an import pipeline for a container registry. */ +@Fluent +public final class ImportPipelineInner extends ProxyResource { + /* + * The location of the import pipeline. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The identity of the import pipeline. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The properties of the import pipeline. + */ + @JsonProperty(value = "properties") + private ImportPipelineProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the location property: The location of the import pipeline. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the import pipeline. + * + * @param location the location value to set. + * @return the ImportPipelineInner object itself. + */ + public ImportPipelineInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the identity property: The identity of the import pipeline. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the import pipeline. + * + * @param identity the identity value to set. + * @return the ImportPipelineInner object itself. + */ + public ImportPipelineInner withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The properties of the import pipeline. + * + * @return the innerProperties value. + */ + private ImportPipelineProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the source property: The source properties of the import pipeline. + * + * @return the source value. + */ + public ImportPipelineSourceProperties source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Set the source property: The source properties of the import pipeline. + * + * @param source the source value to set. + * @return the ImportPipelineInner object itself. + */ + public ImportPipelineInner withSource(ImportPipelineSourceProperties source) { + if (this.innerProperties() == null) { + this.innerProperties = new ImportPipelineProperties(); + } + this.innerProperties().withSource(source); + return this; + } + + /** + * Get the trigger property: The properties that describe the trigger of the import pipeline. + * + * @return the trigger value. + */ + public PipelineTriggerProperties trigger() { + return this.innerProperties() == null ? null : this.innerProperties().trigger(); + } + + /** + * Set the trigger property: The properties that describe the trigger of the import pipeline. + * + * @param trigger the trigger value to set. + * @return the ImportPipelineInner object itself. + */ + public ImportPipelineInner withTrigger(PipelineTriggerProperties trigger) { + if (this.innerProperties() == null) { + this.innerProperties = new ImportPipelineProperties(); + } + this.innerProperties().withTrigger(trigger); + return this; + } + + /** + * Get the options property: The list of all options configured for the pipeline. + * + * @return the options value. + */ + public List options() { + return this.innerProperties() == null ? null : this.innerProperties().options(); + } + + /** + * Set the options property: The list of all options configured for the pipeline. + * + * @param options the options value to set. + * @return the ImportPipelineInner object itself. + */ + public ImportPipelineInner withOptions(List options) { + if (this.innerProperties() == null) { + this.innerProperties = new ImportPipelineProperties(); + } + this.innerProperties().withOptions(options); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the pipeline at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ImportPipelineProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ImportPipelineProperties.java new file mode 100644 index 000000000000..c370580d0496 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ImportPipelineProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipelineSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineOptions; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineTriggerProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of an import pipeline. */ +@Fluent +public final class ImportPipelineProperties { + /* + * The source properties of the import pipeline. + */ + @JsonProperty(value = "source", required = true) + private ImportPipelineSourceProperties source; + + /* + * The properties that describe the trigger of the import pipeline. + */ + @JsonProperty(value = "trigger") + private PipelineTriggerProperties trigger; + + /* + * The list of all options configured for the pipeline. + */ + @JsonProperty(value = "options") + private List options; + + /* + * The provisioning state of the pipeline at the time the operation was + * called. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the source property: The source properties of the import pipeline. + * + * @return the source value. + */ + public ImportPipelineSourceProperties source() { + return this.source; + } + + /** + * Set the source property: The source properties of the import pipeline. + * + * @param source the source value to set. + * @return the ImportPipelineProperties object itself. + */ + public ImportPipelineProperties withSource(ImportPipelineSourceProperties source) { + this.source = source; + return this; + } + + /** + * Get the trigger property: The properties that describe the trigger of the import pipeline. + * + * @return the trigger value. + */ + public PipelineTriggerProperties trigger() { + return this.trigger; + } + + /** + * Set the trigger property: The properties that describe the trigger of the import pipeline. + * + * @param trigger the trigger value to set. + * @return the ImportPipelineProperties object itself. + */ + public ImportPipelineProperties withTrigger(PipelineTriggerProperties trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the options property: The list of all options configured for the pipeline. + * + * @return the options value. + */ + public List options() { + return this.options; + } + + /** + * Set the options property: The list of all options configured for the pipeline. + * + * @param options the options value to set. + * @return the ImportPipelineProperties object itself. + */ + public ImportPipelineProperties withOptions(List options) { + this.options = options; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the pipeline at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property source in model ImportPipelineProperties")); + } else { + source().validate(); + } + if (trigger() != null) { + trigger().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImportPipelineProperties.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/OperationDefinitionInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/OperationDefinitionInner.java new file mode 100644 index 000000000000..559e66511fce --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/OperationDefinitionInner.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.OperationDisplayDefinition; +import com.azure.resourcemanager.containerregistry.generated.models.OperationServiceSpecificationDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The definition of a container registry operation. */ +@Fluent +public final class OperationDefinitionInner { + /* + * The origin information of the container registry operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The display information for the container registry operation. + */ + @JsonProperty(value = "display") + private OperationDisplayDefinition display; + + /* + * The properties information for the container registry operation. + */ + @JsonProperty(value = "properties") + private OperationPropertiesDefinition innerProperties; + + /* + * This property indicates if the operation is an action or a data action + * ref: + * https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /** + * Get the origin property: The origin information of the container registry operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The origin information of the container registry operation. + * + * @param origin the origin value to set. + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set. + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: The display information for the container registry operation. + * + * @return the display value. + */ + public OperationDisplayDefinition display() { + return this.display; + } + + /** + * Set the display property: The display information for the container registry operation. + * + * @param display the display value to set. + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withDisplay(OperationDisplayDefinition display) { + this.display = display; + return this; + } + + /** + * Get the innerProperties property: The properties information for the container registry operation. + * + * @return the innerProperties value. + */ + private OperationPropertiesDefinition innerProperties() { + return this.innerProperties; + } + + /** + * Get the isDataAction property: This property indicates if the operation is an action or a data action ref: + * https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: This property indicates if the operation is an action or a data action ref: + * https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the serviceSpecification property: The definition of Azure Monitoring service. + * + * @return the serviceSpecification value. + */ + public OperationServiceSpecificationDefinition serviceSpecification() { + return this.innerProperties() == null ? null : this.innerProperties().serviceSpecification(); + } + + /** + * Set the serviceSpecification property: The definition of Azure Monitoring service. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withServiceSpecification( + OperationServiceSpecificationDefinition serviceSpecification) { + if (this.innerProperties() == null) { + this.innerProperties = new OperationPropertiesDefinition(); + } + this.innerProperties().withServiceSpecification(serviceSpecification); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/OperationPropertiesDefinition.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/OperationPropertiesDefinition.java new file mode 100644 index 000000000000..8becdccd628b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/OperationPropertiesDefinition.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.OperationServiceSpecificationDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The definition of Azure Monitoring properties. */ +@Fluent +public final class OperationPropertiesDefinition { + /* + * The definition of Azure Monitoring service. + */ + @JsonProperty(value = "serviceSpecification") + private OperationServiceSpecificationDefinition serviceSpecification; + + /** + * Get the serviceSpecification property: The definition of Azure Monitoring service. + * + * @return the serviceSpecification value. + */ + public OperationServiceSpecificationDefinition serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: The definition of Azure Monitoring service. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationPropertiesDefinition object itself. + */ + public OperationPropertiesDefinition withServiceSpecification( + OperationServiceSpecificationDefinition serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PipelineRunInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PipelineRunInner.java new file mode 100644 index 000000000000..ced5841296e0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PipelineRunInner.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunResponse; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An object that represents a pipeline run for a container registry. */ +@Fluent +public final class PipelineRunInner extends ProxyResource { + /* + * The properties of a pipeline run. + */ + @JsonProperty(value = "properties") + private PipelineRunProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The properties of a pipeline run. + * + * @return the innerProperties value. + */ + private PipelineRunProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: The provisioning state of a pipeline run. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the request property: The request parameters for a pipeline run. + * + * @return the request value. + */ + public PipelineRunRequest request() { + return this.innerProperties() == null ? null : this.innerProperties().request(); + } + + /** + * Set the request property: The request parameters for a pipeline run. + * + * @param request the request value to set. + * @return the PipelineRunInner object itself. + */ + public PipelineRunInner withRequest(PipelineRunRequest request) { + if (this.innerProperties() == null) { + this.innerProperties = new PipelineRunProperties(); + } + this.innerProperties().withRequest(request); + return this; + } + + /** + * Get the response property: The response of a pipeline run. + * + * @return the response value. + */ + public PipelineRunResponse response() { + return this.innerProperties() == null ? null : this.innerProperties().response(); + } + + /** + * Get the forceUpdateTag property: How the pipeline run should be forced to recreate even if the pipeline run + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); + } + + /** + * Set the forceUpdateTag property: How the pipeline run should be forced to recreate even if the pipeline run + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the PipelineRunInner object itself. + */ + public PipelineRunInner withForceUpdateTag(String forceUpdateTag) { + if (this.innerProperties() == null) { + this.innerProperties = new PipelineRunProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PipelineRunProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PipelineRunProperties.java new file mode 100644 index 000000000000..a5ded82b2b03 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PipelineRunProperties.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunResponse; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a pipeline run. */ +@Fluent +public final class PipelineRunProperties { + /* + * The provisioning state of a pipeline run. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The request parameters for a pipeline run. + */ + @JsonProperty(value = "request") + private PipelineRunRequest request; + + /* + * The response of a pipeline run. + */ + @JsonProperty(value = "response", access = JsonProperty.Access.WRITE_ONLY) + private PipelineRunResponse response; + + /* + * How the pipeline run should be forced to recreate even if the pipeline + * run configuration has not changed. + */ + @JsonProperty(value = "forceUpdateTag") + private String forceUpdateTag; + + /** + * Get the provisioningState property: The provisioning state of a pipeline run. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the request property: The request parameters for a pipeline run. + * + * @return the request value. + */ + public PipelineRunRequest request() { + return this.request; + } + + /** + * Set the request property: The request parameters for a pipeline run. + * + * @param request the request value to set. + * @return the PipelineRunProperties object itself. + */ + public PipelineRunProperties withRequest(PipelineRunRequest request) { + this.request = request; + return this; + } + + /** + * Get the response property: The response of a pipeline run. + * + * @return the response value. + */ + public PipelineRunResponse response() { + return this.response; + } + + /** + * Get the forceUpdateTag property: How the pipeline run should be forced to recreate even if the pipeline run + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: How the pipeline run should be forced to recreate even if the pipeline run + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the PipelineRunProperties object itself. + */ + public PipelineRunProperties withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (request() != null) { + request().validate(); + } + if (response() != null) { + response().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateEndpointConnectionInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..df14cd7faa20 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An object that represents a private endpoint connection for a container registry. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * The properties of a private endpoint connection. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The properties of a private endpoint connection. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the privateEndpoint property: The resource of private endpoint. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The resource of private endpoint. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of private endpoint connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..55732e028384 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a private endpoint connection. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * The resource of private endpoint. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the privateEndpoint property: The resource of private endpoint. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private endpoint. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of private endpoint connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateLinkResourceInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..3d7ed2449fb9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A resource that supports private link capabilities. */ +@Fluent +public final class PrivateLinkResourceInner { + /* + * The resource type is private link resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * A resource that supports private link capabilities. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /** + * Get the type property: The resource type is private link resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the id property: The resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The resource ID. + * + * @param id the id value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource. + * + * @param name the name value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: A resource that supports private link capabilities. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Set the groupId property: The private link resource group id. + * + * @param groupId the groupId value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withGroupId(String groupId) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withGroupId(groupId); + return this; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Set the requiredMembers property: The private link resource required member names. + * + * @param requiredMembers the requiredMembers value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredMembers(List requiredMembers) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredMembers(requiredMembers); + return this; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateLinkResourceProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..713379b6415f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId") + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers") + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: The private link resource group id. + * + * @param groupId the groupId value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Set the requiredMembers property: The private link resource required member names. + * + * @param requiredMembers the requiredMembers value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredMembers(List requiredMembers) { + this.requiredMembers = requiredMembers; + return this; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryInner.java new file mode 100644 index 000000000000..a986e0f31672 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryInner.java @@ -0,0 +1,411 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.EncryptionProperty; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.NetworkRuleBypassOptions; +import com.azure.resourcemanager.containerregistry.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.containerregistry.generated.models.Policies; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.containerregistry.generated.models.Sku; +import com.azure.resourcemanager.containerregistry.generated.models.Status; +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An object that represents a container registry. */ +@Fluent +public final class RegistryInner extends Resource { + /* + * The SKU of the container registry. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /* + * The identity of the container registry. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The properties of the container registry. + */ + @JsonProperty(value = "properties") + private RegistryProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the sku property: The SKU of the container registry. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the container registry. + * + * @param sku the sku value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: The identity of the container registry. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the container registry. + * + * @param identity the identity value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: The properties of the container registry. + * + * @return the innerProperties value. + */ + private RegistryProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public RegistryInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public RegistryInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the loginServer property: The URL that can be used to log into the container registry. + * + * @return the loginServer value. + */ + public String loginServer() { + return this.innerProperties() == null ? null : this.innerProperties().loginServer(); + } + + /** + * Get the creationDate property: The creation date of the container registry in ISO8601 format. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.innerProperties() == null ? null : this.innerProperties().creationDate(); + } + + /** + * Get the provisioningState property: The provisioning state of the container registry at the time the operation + * was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the status property: The status of the container registry at the time the operation was called. + * + * @return the status value. + */ + public Status status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the adminUserEnabled property: The value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value. + */ + public Boolean adminUserEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().adminUserEnabled(); + } + + /** + * Set the adminUserEnabled property: The value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withAdminUserEnabled(Boolean adminUserEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withAdminUserEnabled(adminUserEnabled); + return this; + } + + /** + * Get the networkRuleSet property: The network rule set for a container registry. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.innerProperties() == null ? null : this.innerProperties().networkRuleSet(); + } + + /** + * Set the networkRuleSet property: The network rule set for a container registry. + * + * @param networkRuleSet the networkRuleSet value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withNetworkRuleSet(networkRuleSet); + return this; + } + + /** + * Get the policies property: The policies for a container registry. + * + * @return the policies value. + */ + public Policies policies() { + return this.innerProperties() == null ? null : this.innerProperties().policies(); + } + + /** + * Set the policies property: The policies for a container registry. + * + * @param policies the policies value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withPolicies(Policies policies) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withPolicies(policies); + return this; + } + + /** + * Get the encryption property: The encryption settings of container registry. + * + * @return the encryption value. + */ + public EncryptionProperty encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: The encryption settings of container registry. + * + * @param encryption the encryption value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withEncryption(EncryptionProperty encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the dataEndpointEnabled property: Enable a single data endpoint per region for serving data. + * + * @return the dataEndpointEnabled value. + */ + public Boolean dataEndpointEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().dataEndpointEnabled(); + } + + /** + * Set the dataEndpointEnabled property: Enable a single data endpoint per region for serving data. + * + * @param dataEndpointEnabled the dataEndpointEnabled value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withDataEndpointEnabled(Boolean dataEndpointEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withDataEndpointEnabled(dataEndpointEnabled); + return this; + } + + /** + * Get the dataEndpointHostNames property: List of host names that will serve data when dataEndpointEnabled is true. + * + * @return the dataEndpointHostNames value. + */ + public List dataEndpointHostNames() { + return this.innerProperties() == null ? null : this.innerProperties().dataEndpointHostNames(); + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections for a container registry. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Get the publicNetworkAccess property: Whether or not public network access is allowed for the container registry. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Whether or not public network access is allowed for the container registry. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a network restricted + * registry. + * + * @return the networkRuleBypassOptions value. + */ + public NetworkRuleBypassOptions networkRuleBypassOptions() { + return this.innerProperties() == null ? null : this.innerProperties().networkRuleBypassOptions(); + } + + /** + * Set the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a network restricted + * registry. + * + * @param networkRuleBypassOptions the networkRuleBypassOptions value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withNetworkRuleBypassOptions(NetworkRuleBypassOptions networkRuleBypassOptions) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withNetworkRuleBypassOptions(networkRuleBypassOptions); + return this; + } + + /** + * Get the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry. + * + * @return the zoneRedundancy value. + */ + public ZoneRedundancy zoneRedundancy() { + return this.innerProperties() == null ? null : this.innerProperties().zoneRedundancy(); + } + + /** + * Set the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry. + * + * @param zoneRedundancy the zoneRedundancy value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withZoneRedundancy(ZoneRedundancy zoneRedundancy) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withZoneRedundancy(zoneRedundancy); + return this; + } + + /** + * Get the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @return the anonymousPullEnabled value. + */ + public Boolean anonymousPullEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().anonymousPullEnabled(); + } + + /** + * Set the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @param anonymousPullEnabled the anonymousPullEnabled value to set. + * @return the RegistryInner object itself. + */ + public RegistryInner withAnonymousPullEnabled(Boolean anonymousPullEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryProperties(); + } + this.innerProperties().withAnonymousPullEnabled(anonymousPullEnabled); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sku in model RegistryInner")); + } else { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RegistryInner.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryListCredentialsResultInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryListCredentialsResultInner.java new file mode 100644 index 000000000000..25920dd2f586 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryListCredentialsResultInner.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryPassword; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the ListCredentials operation. */ +@Fluent +public final class RegistryListCredentialsResultInner { + /* + * The username for a container registry. + */ + @JsonProperty(value = "username") + private String username; + + /* + * The list of passwords for a container registry. + */ + @JsonProperty(value = "passwords") + private List passwords; + + /** + * Get the username property: The username for a container registry. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username for a container registry. + * + * @param username the username value to set. + * @return the RegistryListCredentialsResultInner object itself. + */ + public RegistryListCredentialsResultInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the passwords property: The list of passwords for a container registry. + * + * @return the passwords value. + */ + public List passwords() { + return this.passwords; + } + + /** + * Set the passwords property: The list of passwords for a container registry. + * + * @param passwords the passwords value to set. + * @return the RegistryListCredentialsResultInner object itself. + */ + public RegistryListCredentialsResultInner withPasswords(List passwords) { + this.passwords = passwords; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (passwords() != null) { + passwords().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryNameStatusInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryNameStatusInner.java new file mode 100644 index 000000000000..b23d03c13cc1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryNameStatusInner.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The result of a request to check the availability of a container registry name. */ +@Fluent +public final class RegistryNameStatusInner { + /* + * The value that indicates whether the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * If any, the reason that the name is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /* + * If any, the error message that provides more detail for the reason that + * the name is not available. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the nameAvailable property: The value that indicates whether the name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: The value that indicates whether the name is available. + * + * @param nameAvailable the nameAvailable value to set. + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason property: If any, the reason that the name is not available. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: If any, the reason that the name is not available. + * + * @param reason the reason value to set. + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: If any, the error message that provides more detail for the reason that the name is not + * available. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: If any, the error message that provides more detail for the reason that the name is not + * available. + * + * @param message the message value to set. + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryProperties.java new file mode 100644 index 000000000000..3e8f0602cd10 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryProperties.java @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.EncryptionProperty; +import com.azure.resourcemanager.containerregistry.generated.models.NetworkRuleBypassOptions; +import com.azure.resourcemanager.containerregistry.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.containerregistry.generated.models.Policies; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.containerregistry.generated.models.Status; +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The properties of a container registry. */ +@Fluent +public final class RegistryProperties { + /* + * The URL that can be used to log into the container registry. + */ + @JsonProperty(value = "loginServer", access = JsonProperty.Access.WRITE_ONLY) + private String loginServer; + + /* + * The creation date of the container registry in ISO8601 format. + */ + @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * The provisioning state of the container registry at the time the + * operation was called. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The status of the container registry at the time the operation was + * called. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /* + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "adminUserEnabled") + private Boolean adminUserEnabled; + + /* + * The network rule set for a container registry. + */ + @JsonProperty(value = "networkRuleSet") + private NetworkRuleSet networkRuleSet; + + /* + * The policies for a container registry. + */ + @JsonProperty(value = "policies") + private Policies policies; + + /* + * The encryption settings of container registry. + */ + @JsonProperty(value = "encryption") + private EncryptionProperty encryption; + + /* + * Enable a single data endpoint per region for serving data. + */ + @JsonProperty(value = "dataEndpointEnabled") + private Boolean dataEndpointEnabled; + + /* + * List of host names that will serve data when dataEndpointEnabled is + * true. + */ + @JsonProperty(value = "dataEndpointHostNames", access = JsonProperty.Access.WRITE_ONLY) + private List dataEndpointHostNames; + + /* + * List of private endpoint connections for a container registry. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * Whether or not public network access is allowed for the container + * registry. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * Whether to allow trusted Azure services to access a network restricted + * registry. + */ + @JsonProperty(value = "networkRuleBypassOptions") + private NetworkRuleBypassOptions networkRuleBypassOptions; + + /* + * Whether or not zone redundancy is enabled for this container registry + */ + @JsonProperty(value = "zoneRedundancy") + private ZoneRedundancy zoneRedundancy; + + /* + * Enables registry-wide pull from unauthenticated clients. + */ + @JsonProperty(value = "anonymousPullEnabled") + private Boolean anonymousPullEnabled; + + /** + * Get the loginServer property: The URL that can be used to log into the container registry. + * + * @return the loginServer value. + */ + public String loginServer() { + return this.loginServer; + } + + /** + * Get the creationDate property: The creation date of the container registry in ISO8601 format. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Get the provisioningState property: The provisioning state of the container registry at the time the operation + * was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: The status of the container registry at the time the operation was called. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Get the adminUserEnabled property: The value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value. + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the adminUserEnabled property: The value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the networkRuleSet property: The network rule set for a container registry. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set the networkRuleSet property: The network rule set for a container registry. + * + * @param networkRuleSet the networkRuleSet value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get the policies property: The policies for a container registry. + * + * @return the policies value. + */ + public Policies policies() { + return this.policies; + } + + /** + * Set the policies property: The policies for a container registry. + * + * @param policies the policies value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withPolicies(Policies policies) { + this.policies = policies; + return this; + } + + /** + * Get the encryption property: The encryption settings of container registry. + * + * @return the encryption value. + */ + public EncryptionProperty encryption() { + return this.encryption; + } + + /** + * Set the encryption property: The encryption settings of container registry. + * + * @param encryption the encryption value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withEncryption(EncryptionProperty encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the dataEndpointEnabled property: Enable a single data endpoint per region for serving data. + * + * @return the dataEndpointEnabled value. + */ + public Boolean dataEndpointEnabled() { + return this.dataEndpointEnabled; + } + + /** + * Set the dataEndpointEnabled property: Enable a single data endpoint per region for serving data. + * + * @param dataEndpointEnabled the dataEndpointEnabled value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withDataEndpointEnabled(Boolean dataEndpointEnabled) { + this.dataEndpointEnabled = dataEndpointEnabled; + return this; + } + + /** + * Get the dataEndpointHostNames property: List of host names that will serve data when dataEndpointEnabled is true. + * + * @return the dataEndpointHostNames value. + */ + public List dataEndpointHostNames() { + return this.dataEndpointHostNames; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections for a container registry. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the publicNetworkAccess property: Whether or not public network access is allowed for the container registry. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Whether or not public network access is allowed for the container registry. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a network restricted + * registry. + * + * @return the networkRuleBypassOptions value. + */ + public NetworkRuleBypassOptions networkRuleBypassOptions() { + return this.networkRuleBypassOptions; + } + + /** + * Set the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a network restricted + * registry. + * + * @param networkRuleBypassOptions the networkRuleBypassOptions value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withNetworkRuleBypassOptions(NetworkRuleBypassOptions networkRuleBypassOptions) { + this.networkRuleBypassOptions = networkRuleBypassOptions; + return this; + } + + /** + * Get the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry. + * + * @return the zoneRedundancy value. + */ + public ZoneRedundancy zoneRedundancy() { + return this.zoneRedundancy; + } + + /** + * Set the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry. + * + * @param zoneRedundancy the zoneRedundancy value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withZoneRedundancy(ZoneRedundancy zoneRedundancy) { + this.zoneRedundancy = zoneRedundancy; + return this; + } + + /** + * Get the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @return the anonymousPullEnabled value. + */ + public Boolean anonymousPullEnabled() { + return this.anonymousPullEnabled; + } + + /** + * Set the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @param anonymousPullEnabled the anonymousPullEnabled value to set. + * @return the RegistryProperties object itself. + */ + public RegistryProperties withAnonymousPullEnabled(Boolean anonymousPullEnabled) { + this.anonymousPullEnabled = anonymousPullEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + if (networkRuleSet() != null) { + networkRuleSet().validate(); + } + if (policies() != null) { + policies().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryPropertiesUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryPropertiesUpdateParameters.java new file mode 100644 index 000000000000..8ab25f11b4c5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryPropertiesUpdateParameters.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.EncryptionProperty; +import com.azure.resourcemanager.containerregistry.generated.models.NetworkRuleBypassOptions; +import com.azure.resourcemanager.containerregistry.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.containerregistry.generated.models.Policies; +import com.azure.resourcemanager.containerregistry.generated.models.PublicNetworkAccess; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters for updating the properties of a container registry. */ +@Fluent +public final class RegistryPropertiesUpdateParameters { + /* + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "adminUserEnabled") + private Boolean adminUserEnabled; + + /* + * The network rule set for a container registry. + */ + @JsonProperty(value = "networkRuleSet") + private NetworkRuleSet networkRuleSet; + + /* + * The policies for a container registry. + */ + @JsonProperty(value = "policies") + private Policies policies; + + /* + * The encryption settings of container registry. + */ + @JsonProperty(value = "encryption") + private EncryptionProperty encryption; + + /* + * Enable a single data endpoint per region for serving data. + */ + @JsonProperty(value = "dataEndpointEnabled") + private Boolean dataEndpointEnabled; + + /* + * Whether or not public network access is allowed for the container + * registry. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * Whether to allow trusted Azure services to access a network restricted + * registry. + */ + @JsonProperty(value = "networkRuleBypassOptions") + private NetworkRuleBypassOptions networkRuleBypassOptions; + + /* + * Enables registry-wide pull from unauthenticated clients. + */ + @JsonProperty(value = "anonymousPullEnabled") + private Boolean anonymousPullEnabled; + + /** + * Get the adminUserEnabled property: The value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value. + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the adminUserEnabled property: The value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set. + * @return the RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the networkRuleSet property: The network rule set for a container registry. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set the networkRuleSet property: The network rule set for a container registry. + * + * @param networkRuleSet the networkRuleSet value to set. + * @return the RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get the policies property: The policies for a container registry. + * + * @return the policies value. + */ + public Policies policies() { + return this.policies; + } + + /** + * Set the policies property: The policies for a container registry. + * + * @param policies the policies value to set. + * @return the RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters withPolicies(Policies policies) { + this.policies = policies; + return this; + } + + /** + * Get the encryption property: The encryption settings of container registry. + * + * @return the encryption value. + */ + public EncryptionProperty encryption() { + return this.encryption; + } + + /** + * Set the encryption property: The encryption settings of container registry. + * + * @param encryption the encryption value to set. + * @return the RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters withEncryption(EncryptionProperty encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the dataEndpointEnabled property: Enable a single data endpoint per region for serving data. + * + * @return the dataEndpointEnabled value. + */ + public Boolean dataEndpointEnabled() { + return this.dataEndpointEnabled; + } + + /** + * Set the dataEndpointEnabled property: Enable a single data endpoint per region for serving data. + * + * @param dataEndpointEnabled the dataEndpointEnabled value to set. + * @return the RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters withDataEndpointEnabled(Boolean dataEndpointEnabled) { + this.dataEndpointEnabled = dataEndpointEnabled; + return this; + } + + /** + * Get the publicNetworkAccess property: Whether or not public network access is allowed for the container registry. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Whether or not public network access is allowed for the container registry. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a network restricted + * registry. + * + * @return the networkRuleBypassOptions value. + */ + public NetworkRuleBypassOptions networkRuleBypassOptions() { + return this.networkRuleBypassOptions; + } + + /** + * Set the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a network restricted + * registry. + * + * @param networkRuleBypassOptions the networkRuleBypassOptions value to set. + * @return the RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters withNetworkRuleBypassOptions( + NetworkRuleBypassOptions networkRuleBypassOptions) { + this.networkRuleBypassOptions = networkRuleBypassOptions; + return this; + } + + /** + * Get the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @return the anonymousPullEnabled value. + */ + public Boolean anonymousPullEnabled() { + return this.anonymousPullEnabled; + } + + /** + * Set the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @param anonymousPullEnabled the anonymousPullEnabled value to set. + * @return the RegistryPropertiesUpdateParameters object itself. + */ + public RegistryPropertiesUpdateParameters withAnonymousPullEnabled(Boolean anonymousPullEnabled) { + this.anonymousPullEnabled = anonymousPullEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkRuleSet() != null) { + networkRuleSet().validate(); + } + if (policies() != null) { + policies().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryUsageListResultInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryUsageListResultInner.java new file mode 100644 index 000000000000..ded96869f29d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/RegistryUsageListResultInner.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryUsage; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to get container registry quota usages. */ +@Fluent +public final class RegistryUsageListResultInner { + /* + * The list of container registry quota usages. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of container registry quota usages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of container registry quota usages. + * + * @param value the value value to set. + * @return the RegistryUsageListResultInner object itself. + */ + public RegistryUsageListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationInner.java new file mode 100644 index 000000000000..48efe2166ad7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.Status; +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** An object that represents a replication for a container registry. */ +@Fluent +public final class ReplicationInner extends Resource { + /* + * The properties of the replication. + */ + @JsonProperty(value = "properties") + private ReplicationProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The properties of the replication. + * + * @return the innerProperties value. + */ + private ReplicationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ReplicationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ReplicationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the replication at the time the operation was + * called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the status property: The status of the replication at the time the operation was called. + * + * @return the status value. + */ + public Status status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue + * to be synced with other replications. + * + * @return the regionEndpointEnabled value. + */ + public Boolean regionEndpointEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().regionEndpointEnabled(); + } + + /** + * Set the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue + * to be synced with other replications. + * + * @param regionEndpointEnabled the regionEndpointEnabled value to set. + * @return the ReplicationInner object itself. + */ + public ReplicationInner withRegionEndpointEnabled(Boolean regionEndpointEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new ReplicationProperties(); + } + this.innerProperties().withRegionEndpointEnabled(regionEndpointEnabled); + return this; + } + + /** + * Get the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry + * replication. + * + * @return the zoneRedundancy value. + */ + public ZoneRedundancy zoneRedundancy() { + return this.innerProperties() == null ? null : this.innerProperties().zoneRedundancy(); + } + + /** + * Set the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry + * replication. + * + * @param zoneRedundancy the zoneRedundancy value to set. + * @return the ReplicationInner object itself. + */ + public ReplicationInner withZoneRedundancy(ZoneRedundancy zoneRedundancy) { + if (this.innerProperties() == null) { + this.innerProperties = new ReplicationProperties(); + } + this.innerProperties().withZoneRedundancy(zoneRedundancy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationProperties.java new file mode 100644 index 000000000000..b58b2ad9044c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationProperties.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.Status; +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of a replication. */ +@Fluent +public final class ReplicationProperties { + /* + * The provisioning state of the replication at the time the operation was + * called. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The status of the replication at the time the operation was called. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /* + * Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is + * disabled, however its data will continue to be synced with other + * replications. + */ + @JsonProperty(value = "regionEndpointEnabled") + private Boolean regionEndpointEnabled; + + /* + * Whether or not zone redundancy is enabled for this container registry + * replication + */ + @JsonProperty(value = "zoneRedundancy") + private ZoneRedundancy zoneRedundancy; + + /** + * Get the provisioningState property: The provisioning state of the replication at the time the operation was + * called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: The status of the replication at the time the operation was called. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Get the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue + * to be synced with other replications. + * + * @return the regionEndpointEnabled value. + */ + public Boolean regionEndpointEnabled() { + return this.regionEndpointEnabled; + } + + /** + * Set the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue + * to be synced with other replications. + * + * @param regionEndpointEnabled the regionEndpointEnabled value to set. + * @return the ReplicationProperties object itself. + */ + public ReplicationProperties withRegionEndpointEnabled(Boolean regionEndpointEnabled) { + this.regionEndpointEnabled = regionEndpointEnabled; + return this; + } + + /** + * Get the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry + * replication. + * + * @return the zoneRedundancy value. + */ + public ZoneRedundancy zoneRedundancy() { + return this.zoneRedundancy; + } + + /** + * Set the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry + * replication. + * + * @param zoneRedundancy the zoneRedundancy value to set. + * @return the ReplicationProperties object itself. + */ + public ReplicationProperties withZoneRedundancy(ZoneRedundancy zoneRedundancy) { + this.zoneRedundancy = zoneRedundancy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() != null) { + status().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationUpdateParametersProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationUpdateParametersProperties.java new file mode 100644 index 000000000000..2fd2b2d8d856 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ReplicationUpdateParametersProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ReplicationUpdateParametersProperties model. */ +@Fluent +public final class ReplicationUpdateParametersProperties { + /* + * Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is + * disabled, however its data will continue to be synced with other + * replications. + */ + @JsonProperty(value = "regionEndpointEnabled") + private Boolean regionEndpointEnabled; + + /** + * Get the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue + * to be synced with other replications. + * + * @return the regionEndpointEnabled value. + */ + public Boolean regionEndpointEnabled() { + return this.regionEndpointEnabled; + } + + /** + * Set the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue + * to be synced with other replications. + * + * @param regionEndpointEnabled the regionEndpointEnabled value to set. + * @return the ReplicationUpdateParametersProperties object itself. + */ + public ReplicationUpdateParametersProperties withRegionEndpointEnabled(Boolean regionEndpointEnabled) { + this.regionEndpointEnabled = regionEndpointEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapInner.java new file mode 100644 index 000000000000..2319fad47af6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapInner.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** An object that represents a scope map for a container registry. */ +@Fluent +public final class ScopeMapInner extends ProxyResource { + /* + * The properties of the scope map. + */ + @JsonProperty(value = "properties") + private ScopeMapProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The properties of the scope map. + * + * @return the innerProperties value. + */ + private ScopeMapProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the description property: The user friendly description of the scope map. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The user friendly description of the scope map. + * + * @param description the description value to set. + * @return the ScopeMapInner object itself. + */ + public ScopeMapInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ScopeMapProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the type property: The type of the scope map. E.g. BuildIn scope map. + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Get the creationDate property: The creation date of scope map. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.innerProperties() == null ? null : this.innerProperties().creationDate(); + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the actions property: The list of scoped permissions for registry artifacts. E.g. + * repositories/repository-name/content/read, repositories/repository-name/metadata/write. + * + * @return the actions value. + */ + public List actions() { + return this.innerProperties() == null ? null : this.innerProperties().actions(); + } + + /** + * Set the actions property: The list of scoped permissions for registry artifacts. E.g. + * repositories/repository-name/content/read, repositories/repository-name/metadata/write. + * + * @param actions the actions value to set. + * @return the ScopeMapInner object itself. + */ + public ScopeMapInner withActions(List actions) { + if (this.innerProperties() == null) { + this.innerProperties = new ScopeMapProperties(); + } + this.innerProperties().withActions(actions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapProperties.java new file mode 100644 index 000000000000..1cdc257bd705 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapProperties.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The properties of a scope map. */ +@Fluent +public final class ScopeMapProperties { + /* + * The user friendly description of the scope map. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The type of the scope map. E.g. BuildIn scope map. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The creation date of scope map. + */ + @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The list of scoped permissions for registry artifacts. + * E.g. repositories/repository-name/content/read, + * repositories/repository-name/metadata/write + */ + @JsonProperty(value = "actions", required = true) + private List actions; + + /** + * Get the description property: The user friendly description of the scope map. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The user friendly description of the scope map. + * + * @param description the description value to set. + * @return the ScopeMapProperties object itself. + */ + public ScopeMapProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the type property: The type of the scope map. E.g. BuildIn scope map. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the creationDate property: The creation date of scope map. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the actions property: The list of scoped permissions for registry artifacts. E.g. + * repositories/repository-name/content/read, repositories/repository-name/metadata/write. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: The list of scoped permissions for registry artifacts. E.g. + * repositories/repository-name/content/read, repositories/repository-name/metadata/write. + * + * @param actions the actions value to set. + * @return the ScopeMapProperties object itself. + */ + public ScopeMapProperties withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actions() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property actions in model ScopeMapProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScopeMapProperties.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapPropertiesUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapPropertiesUpdateParameters.java new file mode 100644 index 000000000000..a227eb8ee511 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/ScopeMapPropertiesUpdateParameters.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The update parameters for scope map properties. */ +@Fluent +public final class ScopeMapPropertiesUpdateParameters { + /* + * The user friendly description of the scope map. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The list of scope permissions for registry artifacts. + * E.g. repositories/repository-name/pull, + * repositories/repository-name/delete + */ + @JsonProperty(value = "actions") + private List actions; + + /** + * Get the description property: The user friendly description of the scope map. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The user friendly description of the scope map. + * + * @param description the description value to set. + * @return the ScopeMapPropertiesUpdateParameters object itself. + */ + public ScopeMapPropertiesUpdateParameters withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actions property: The list of scope permissions for registry artifacts. E.g. + * repositories/repository-name/pull, repositories/repository-name/delete. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: The list of scope permissions for registry artifacts. E.g. + * repositories/repository-name/pull, repositories/repository-name/delete. + * + * @param actions the actions value to set. + * @return the ScopeMapPropertiesUpdateParameters object itself. + */ + public ScopeMapPropertiesUpdateParameters withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenInner.java new file mode 100644 index 000000000000..de9d67be8b56 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenInner.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCredentialsProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TokenStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** An object that represents a token for a container registry. */ +@Fluent +public final class TokenInner extends ProxyResource { + /* + * The properties of the token. + */ + @JsonProperty(value = "properties") + private TokenProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The properties of the token. + * + * @return the innerProperties value. + */ + private TokenProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the creationDate property: The creation date of scope map. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.innerProperties() == null ? null : this.innerProperties().creationDate(); + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the scopeMapId property: The resource ID of the scope map to which the token will be associated with. + * + * @return the scopeMapId value. + */ + public String scopeMapId() { + return this.innerProperties() == null ? null : this.innerProperties().scopeMapId(); + } + + /** + * Set the scopeMapId property: The resource ID of the scope map to which the token will be associated with. + * + * @param scopeMapId the scopeMapId value to set. + * @return the TokenInner object itself. + */ + public TokenInner withScopeMapId(String scopeMapId) { + if (this.innerProperties() == null) { + this.innerProperties = new TokenProperties(); + } + this.innerProperties().withScopeMapId(scopeMapId); + return this; + } + + /** + * Get the credentials property: The credentials that can be used for authenticating the token. + * + * @return the credentials value. + */ + public TokenCredentialsProperties credentials() { + return this.innerProperties() == null ? null : this.innerProperties().credentials(); + } + + /** + * Set the credentials property: The credentials that can be used for authenticating the token. + * + * @param credentials the credentials value to set. + * @return the TokenInner object itself. + */ + public TokenInner withCredentials(TokenCredentialsProperties credentials) { + if (this.innerProperties() == null) { + this.innerProperties = new TokenProperties(); + } + this.innerProperties().withCredentials(credentials); + return this; + } + + /** + * Get the status property: The status of the token example enabled or disabled. + * + * @return the status value. + */ + public TokenStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the token example enabled or disabled. + * + * @param status the status value to set. + * @return the TokenInner object itself. + */ + public TokenInner withStatus(TokenStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new TokenProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenProperties.java new file mode 100644 index 000000000000..97473d337750 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenProperties.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCredentialsProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TokenStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The properties of a token. */ +@Fluent +public final class TokenProperties { + /* + * The creation date of scope map. + */ + @JsonProperty(value = "creationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationDate; + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The resource ID of the scope map to which the token will be associated + * with. + */ + @JsonProperty(value = "scopeMapId") + private String scopeMapId; + + /* + * The credentials that can be used for authenticating the token. + */ + @JsonProperty(value = "credentials") + private TokenCredentialsProperties credentials; + + /* + * The status of the token example enabled or disabled. + */ + @JsonProperty(value = "status") + private TokenStatus status; + + /** + * Get the creationDate property: The creation date of scope map. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the scopeMapId property: The resource ID of the scope map to which the token will be associated with. + * + * @return the scopeMapId value. + */ + public String scopeMapId() { + return this.scopeMapId; + } + + /** + * Set the scopeMapId property: The resource ID of the scope map to which the token will be associated with. + * + * @param scopeMapId the scopeMapId value to set. + * @return the TokenProperties object itself. + */ + public TokenProperties withScopeMapId(String scopeMapId) { + this.scopeMapId = scopeMapId; + return this; + } + + /** + * Get the credentials property: The credentials that can be used for authenticating the token. + * + * @return the credentials value. + */ + public TokenCredentialsProperties credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials that can be used for authenticating the token. + * + * @param credentials the credentials value to set. + * @return the TokenProperties object itself. + */ + public TokenProperties withCredentials(TokenCredentialsProperties credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the status property: The status of the token example enabled or disabled. + * + * @return the status value. + */ + public TokenStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the token example enabled or disabled. + * + * @param status the status value to set. + * @return the TokenProperties object itself. + */ + public TokenProperties withStatus(TokenStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenUpdateProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenUpdateProperties.java new file mode 100644 index 000000000000..48dadeddd859 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/TokenUpdateProperties.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCredentialsProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TokenStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters for updating token properties. */ +@Fluent +public final class TokenUpdateProperties { + /* + * The resource ID of the scope map to which the token will be associated + * with. + */ + @JsonProperty(value = "scopeMapId") + private String scopeMapId; + + /* + * The status of the token example enabled or disabled. + */ + @JsonProperty(value = "status") + private TokenStatus status; + + /* + * The credentials that can be used for authenticating the token. + */ + @JsonProperty(value = "credentials") + private TokenCredentialsProperties credentials; + + /** + * Get the scopeMapId property: The resource ID of the scope map to which the token will be associated with. + * + * @return the scopeMapId value. + */ + public String scopeMapId() { + return this.scopeMapId; + } + + /** + * Set the scopeMapId property: The resource ID of the scope map to which the token will be associated with. + * + * @param scopeMapId the scopeMapId value to set. + * @return the TokenUpdateProperties object itself. + */ + public TokenUpdateProperties withScopeMapId(String scopeMapId) { + this.scopeMapId = scopeMapId; + return this; + } + + /** + * Get the status property: The status of the token example enabled or disabled. + * + * @return the status value. + */ + public TokenStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the token example enabled or disabled. + * + * @param status the status value to set. + * @return the TokenUpdateProperties object itself. + */ + public TokenUpdateProperties withStatus(TokenStatus status) { + this.status = status; + return this; + } + + /** + * Get the credentials property: The credentials that can be used for authenticating the token. + * + * @return the credentials value. + */ + public TokenCredentialsProperties credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials that can be used for authenticating the token. + * + * @param credentials the credentials value to set. + * @return the TokenUpdateProperties object itself. + */ + public TokenUpdateProperties withCredentials(TokenCredentialsProperties credentials) { + this.credentials = credentials; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookInner.java new file mode 100644 index 000000000000..8d6e11ee1d9f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookInner.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** An object that represents a webhook for a container registry. */ +@Fluent +public final class WebhookInner extends Resource { + /* + * The properties of the webhook. + */ + @JsonProperty(value = "properties") + private WebhookProperties innerProperties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The properties of the webhook. + * + * @return the innerProperties value. + */ + private WebhookProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public WebhookInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public WebhookInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the status property: The status of the webhook at the time the operation was called. + * + * @return the status value. + */ + public WebhookStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the webhook at the time the operation was called. + * + * @param status the status value to set. + * @return the WebhookInner object itself. + */ + public WebhookInner withStatus(WebhookStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + * 'foo:latest'. Empty means all events. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + * 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set. + * @return the WebhookInner object itself. + */ + public WebhookInner withScope(String scope) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookProperties(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the actions property: The list of actions that trigger the webhook to post notifications. + * + * @return the actions value. + */ + public List actions() { + return this.innerProperties() == null ? null : this.innerProperties().actions(); + } + + /** + * Set the actions property: The list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set. + * @return the WebhookInner object itself. + */ + public WebhookInner withActions(List actions) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookProperties(); + } + this.innerProperties().withActions(actions); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the webhook at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookProperties.java new file mode 100644 index 000000000000..bc151531f7f0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookProperties.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of a webhook. */ +@Fluent +public final class WebhookProperties { + /* + * The status of the webhook at the time the operation was called. + */ + @JsonProperty(value = "status") + private WebhookStatus status; + + /* + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "actions", required = true) + private List actions; + + /* + * The provisioning state of the webhook at the time the operation was + * called. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the status property: The status of the webhook at the time the operation was called. + * + * @return the status value. + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the webhook at the time the operation was called. + * + * @param status the status value to set. + * @return the WebhookProperties object itself. + */ + public WebhookProperties withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + * 'foo:latest'. Empty means all events. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + * 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set. + * @return the WebhookProperties object itself. + */ + public WebhookProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the actions property: The list of actions that trigger the webhook to post notifications. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: The list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set. + * @return the WebhookProperties object itself. + */ + public WebhookProperties withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the webhook at the time the operation was called. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actions() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property actions in model WebhookProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebhookProperties.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookPropertiesCreateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookPropertiesCreateParameters.java new file mode 100644 index 000000000000..e9eed9810aec --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookPropertiesCreateParameters.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The parameters for creating the properties of a webhook. */ +@Fluent +public final class WebhookPropertiesCreateParameters { + /* + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "serviceUri", required = true) + private String serviceUri; + + /* + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "customHeaders") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map customHeaders; + + /* + * The status of the webhook at the time the operation was called. + */ + @JsonProperty(value = "status") + private WebhookStatus status; + + /* + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "actions", required = true) + private List actions; + + /** + * Get the serviceUri property: The service URI for the webhook to post notifications. + * + * @return the serviceUri value. + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the serviceUri property: The service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set. + * @return the WebhookPropertiesCreateParameters object itself. + */ + public WebhookPropertiesCreateParameters withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get the customHeaders property: Custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value. + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set the customHeaders property: Custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set. + * @return the WebhookPropertiesCreateParameters object itself. + */ + public WebhookPropertiesCreateParameters withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get the status property: The status of the webhook at the time the operation was called. + * + * @return the status value. + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the webhook at the time the operation was called. + * + * @param status the status value to set. + * @return the WebhookPropertiesCreateParameters object itself. + */ + public WebhookPropertiesCreateParameters withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + * 'foo:latest'. Empty means all events. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + * 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set. + * @return the WebhookPropertiesCreateParameters object itself. + */ + public WebhookPropertiesCreateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the actions property: The list of actions that trigger the webhook to post notifications. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: The list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set. + * @return the WebhookPropertiesCreateParameters object itself. + */ + public WebhookPropertiesCreateParameters withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceUri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serviceUri in model WebhookPropertiesCreateParameters")); + } + if (actions() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property actions in model WebhookPropertiesCreateParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebhookPropertiesCreateParameters.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookPropertiesUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookPropertiesUpdateParameters.java new file mode 100644 index 000000000000..e951466c749e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/WebhookPropertiesUpdateParameters.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The parameters for updating the properties of a webhook. */ +@Fluent +public final class WebhookPropertiesUpdateParameters { + /* + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "serviceUri") + private String serviceUri; + + /* + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "customHeaders") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map customHeaders; + + /* + * The status of the webhook at the time the operation was called. + */ + @JsonProperty(value = "status") + private WebhookStatus status; + + /* + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "scope") + private String scope; + + /* + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "actions") + private List actions; + + /** + * Get the serviceUri property: The service URI for the webhook to post notifications. + * + * @return the serviceUri value. + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the serviceUri property: The service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set. + * @return the WebhookPropertiesUpdateParameters object itself. + */ + public WebhookPropertiesUpdateParameters withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get the customHeaders property: Custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value. + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set the customHeaders property: Custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set. + * @return the WebhookPropertiesUpdateParameters object itself. + */ + public WebhookPropertiesUpdateParameters withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get the status property: The status of the webhook at the time the operation was called. + * + * @return the status value. + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the webhook at the time the operation was called. + * + * @param status the status value to set. + * @return the WebhookPropertiesUpdateParameters object itself. + */ + public WebhookPropertiesUpdateParameters withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + * 'foo:latest'. Empty means all events. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + * 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set. + * @return the WebhookPropertiesUpdateParameters object itself. + */ + public WebhookPropertiesUpdateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the actions property: The list of actions that trigger the webhook to post notifications. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: The list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set. + * @return the WebhookPropertiesUpdateParameters object itself. + */ + public WebhookPropertiesUpdateParameters withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/package-info.java new file mode 100644 index 000000000000..fe41eebca6e1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for ContainerRegistryManagementClient. null. */ +package com.azure.resourcemanager.containerregistry.generated.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/package-info.java new file mode 100644 index 000000000000..6eed057a4348 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for ContainerRegistryManagementClient. null. */ +package com.azure.resourcemanager.containerregistry.generated.fluent; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CallbackConfigImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CallbackConfigImpl.java new file mode 100644 index 000000000000..f92498ee199d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/CallbackConfigImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.CallbackConfigInner; +import com.azure.resourcemanager.containerregistry.generated.models.CallbackConfig; +import java.util.Collections; +import java.util.Map; + +public final class CallbackConfigImpl implements CallbackConfig { + private CallbackConfigInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + CallbackConfigImpl( + CallbackConfigInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String serviceUri() { + return this.innerModel().serviceUri(); + } + + public Map customHeaders() { + Map inner = this.innerModel().customHeaders(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public CallbackConfigInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesClientImpl.java new file mode 100644 index 000000000000..9a927b4961d9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesClientImpl.java @@ -0,0 +1,1854 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.ConnectedRegistriesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryInner; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryListResult; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ConnectedRegistriesClient. */ +public final class ConnectedRegistriesClientImpl implements ConnectedRegistriesClient { + /** The proxy service used to perform REST calls. */ + private final ConnectedRegistriesService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ConnectedRegistriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConnectedRegistriesClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(ConnectedRegistriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientConnectedRegistries to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface ConnectedRegistriesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/connectedRegistries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/connectedRegistries/{connectedRegistryName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("connectedRegistryName") String connectedRegistryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/connectedRegistries/{connectedRegistryName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("connectedRegistryName") String connectedRegistryName, + @BodyParam("application/json") ConnectedRegistryInner connectedRegistryCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/connectedRegistries/{connectedRegistryName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("connectedRegistryName") String connectedRegistryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/connectedRegistries/{connectedRegistryName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("connectedRegistryName") String connectedRegistryName, + @BodyParam("application/json") ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/connectedRegistries/{connectedRegistryName}/deactivate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deactivate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("connectedRegistryName") String connectedRegistryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all connected registries for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter An OData filter expression that describes a subset of connectedRegistries to return. The parameters + * that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and + * connectionState. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all connected registries for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter An OData filter expression that describes a subset of connectedRegistries to return. The parameters + * that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and + * connectionState. The supported operator is eq. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all connected registries for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter An OData filter expression that describes a subset of connectedRegistries to return. The parameters + * that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and + * connectionState. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all connected registries for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all connected registries for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter An OData filter expression that describes a subset of connectedRegistries to return. The parameters + * that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and + * connectionState. The supported operator is eq. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all connected registries for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + final String filter = null; + return new PagedIterable<>(listAsync(resourceGroupName, registryName, filter)); + } + + /** + * Lists all connected registries for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter An OData filter expression that describes a subset of connectedRegistries to return. The parameters + * that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and + * connectionState. The supported operator is eq. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, filter, context)); + } + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String connectedRegistryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + accept, + context); + } + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String connectedRegistryName) { + return getWithResponseAsync(resourceGroupName, registryName, connectedRegistryName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedRegistryInner get(String resourceGroupName, String registryName, String connectedRegistryName) { + return getAsync(resourceGroupName, registryName, connectedRegistryName).block(); + } + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, connectedRegistryName, context).block(); + } + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + if (connectedRegistryCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter connectedRegistryCreateParameters is required and cannot be null.")); + } else { + connectedRegistryCreateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + connectedRegistryCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + if (connectedRegistryCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter connectedRegistryCreateParameters is required and cannot be null.")); + } else { + connectedRegistryCreateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + connectedRegistryCreateParameters, + accept, + context); + } + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConnectedRegistryInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters) { + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectedRegistryInner.class, + ConnectedRegistryInner.class, + this.client.getContext()); + } + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConnectedRegistryInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectedRegistryInner.class, + ConnectedRegistryInner.class, + context); + } + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectedRegistryInner> beginCreate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters) { + return beginCreateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters) + .getSyncPoller(); + } + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectedRegistryInner> beginCreate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters, + Context context) { + return beginCreateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters) { + return beginCreateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters, + Context context) { + return beginCreateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedRegistryInner create( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters) { + return createAsync(resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters) + .block(); + } + + /** + * Creates a connected registry for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryCreateParameters The parameters for creating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedRegistryInner create( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryInner connectedRegistryCreateParameters, + Context context) { + return createAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters, context) + .block(); + } + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String connectedRegistryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + accept, + context); + } + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String connectedRegistryName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, connectedRegistryName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, connectedRegistryName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String connectedRegistryName) { + return beginDeleteAsync(resourceGroupName, registryName, connectedRegistryName).getSyncPoller(); + } + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, connectedRegistryName, context).getSyncPoller(); + } + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String connectedRegistryName) { + return beginDeleteAsync(resourceGroupName, registryName, connectedRegistryName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, connectedRegistryName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String connectedRegistryName) { + deleteAsync(resourceGroupName, registryName, connectedRegistryName).block(); + } + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + deleteAsync(resourceGroupName, registryName, connectedRegistryName, context).block(); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + if (connectedRegistryUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter connectedRegistryUpdateParameters is required and cannot be null.")); + } else { + connectedRegistryUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + connectedRegistryUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + if (connectedRegistryUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter connectedRegistryUpdateParameters is required and cannot be null.")); + } else { + connectedRegistryUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + connectedRegistryUpdateParameters, + accept, + context); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConnectedRegistryInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectedRegistryInner.class, + ConnectedRegistryInner.class, + this.client.getContext()); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConnectedRegistryInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectedRegistryInner.class, + ConnectedRegistryInner.class, + context); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectedRegistryInner> beginUpdate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters) { + return beginUpdateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters) + .getSyncPoller(); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a connected registry for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectedRegistryInner> beginUpdate( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters) { + return beginUpdateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedRegistryInner update( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters) { + return updateAsync(resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters) + .block(); + } + + /** + * Updates a connected registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param connectedRegistryUpdateParameters The parameters for updating a connectedRegistry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a connected registry for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectedRegistryInner update( + String resourceGroupName, + String registryName, + String connectedRegistryName, + ConnectedRegistryUpdateParameters connectedRegistryUpdateParameters, + Context context) { + return updateAsync( + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters, context) + .block(); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deactivateWithResponseAsync( + String resourceGroupName, String registryName, String connectedRegistryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deactivate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deactivateWithResponseAsync( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (connectedRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deactivate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + connectedRegistryName, + accept, + context); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeactivateAsync( + String resourceGroupName, String registryName, String connectedRegistryName) { + Mono>> mono = + deactivateWithResponseAsync(resourceGroupName, registryName, connectedRegistryName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeactivateAsync( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deactivateWithResponseAsync(resourceGroupName, registryName, connectedRegistryName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeactivate( + String resourceGroupName, String registryName, String connectedRegistryName) { + return beginDeactivateAsync(resourceGroupName, registryName, connectedRegistryName).getSyncPoller(); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeactivate( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + return beginDeactivateAsync(resourceGroupName, registryName, connectedRegistryName, context).getSyncPoller(); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deactivateAsync(String resourceGroupName, String registryName, String connectedRegistryName) { + return beginDeactivateAsync(resourceGroupName, registryName, connectedRegistryName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deactivateAsync( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + return beginDeactivateAsync(resourceGroupName, registryName, connectedRegistryName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deactivate(String resourceGroupName, String registryName, String connectedRegistryName) { + deactivateAsync(resourceGroupName, registryName, connectedRegistryName).block(); + } + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deactivate( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + deactivateAsync(resourceGroupName, registryName, connectedRegistryName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesImpl.java new file mode 100644 index 000000000000..791bb10039b8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistriesImpl.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.ConnectedRegistriesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryInner; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistries; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistry; + +public final class ConnectedRegistriesImpl implements ConnectedRegistries { + private static final ClientLogger LOGGER = new ClientLogger(ConnectedRegistriesImpl.class); + + private final ConnectedRegistriesClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public ConnectedRegistriesImpl( + ConnectedRegistriesClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new ConnectedRegistryImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String registryName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, filter, context); + return Utils.mapPage(inner, inner1 -> new ConnectedRegistryImpl(inner1, this.manager())); + } + + public ConnectedRegistry get(String resourceGroupName, String registryName, String connectedRegistryName) { + ConnectedRegistryInner inner = this.serviceClient().get(resourceGroupName, registryName, connectedRegistryName); + if (inner != null) { + return new ConnectedRegistryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, connectedRegistryName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConnectedRegistryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String connectedRegistryName) { + this.serviceClient().delete(resourceGroupName, registryName, connectedRegistryName); + } + + public void delete(String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, connectedRegistryName, context); + } + + public void deactivate(String resourceGroupName, String registryName, String connectedRegistryName) { + this.serviceClient().deactivate(resourceGroupName, registryName, connectedRegistryName); + } + + public void deactivate( + String resourceGroupName, String registryName, String connectedRegistryName, Context context) { + this.serviceClient().deactivate(resourceGroupName, registryName, connectedRegistryName, context); + } + + public ConnectedRegistry getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String connectedRegistryName = Utils.getValueFromIdByName(id, "connectedRegistries"); + if (connectedRegistryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedRegistries'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, connectedRegistryName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String connectedRegistryName = Utils.getValueFromIdByName(id, "connectedRegistries"); + if (connectedRegistryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedRegistries'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, connectedRegistryName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String connectedRegistryName = Utils.getValueFromIdByName(id, "connectedRegistries"); + if (connectedRegistryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedRegistries'.", id))); + } + this.delete(resourceGroupName, registryName, connectedRegistryName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String connectedRegistryName = Utils.getValueFromIdByName(id, "connectedRegistries"); + if (connectedRegistryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedRegistries'.", id))); + } + this.delete(resourceGroupName, registryName, connectedRegistryName, context); + } + + private ConnectedRegistriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public ConnectedRegistryImpl define(String name) { + return new ConnectedRegistryImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistryImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistryImpl.java new file mode 100644 index 000000000000..44da23aec87b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ConnectedRegistryImpl.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryInner; +import com.azure.resourcemanager.containerregistry.generated.models.ActivationProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistry; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryMode; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectionState; +import com.azure.resourcemanager.containerregistry.generated.models.LoggingProperties; +import com.azure.resourcemanager.containerregistry.generated.models.LoginServerProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ParentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.StatusDetailProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SyncUpdateProperties; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class ConnectedRegistryImpl + implements ConnectedRegistry, ConnectedRegistry.Definition, ConnectedRegistry.Update { + private ConnectedRegistryInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ConnectedRegistryMode mode() { + return this.innerModel().mode(); + } + + public String version() { + return this.innerModel().version(); + } + + public ConnectionState connectionState() { + return this.innerModel().connectionState(); + } + + public OffsetDateTime lastActivityTime() { + return this.innerModel().lastActivityTime(); + } + + public ActivationProperties activation() { + return this.innerModel().activation(); + } + + public ParentProperties parent() { + return this.innerModel().parent(); + } + + public List clientTokenIds() { + List inner = this.innerModel().clientTokenIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public LoginServerProperties loginServer() { + return this.innerModel().loginServer(); + } + + public LoggingProperties logging() { + return this.innerModel().logging(); + } + + public List statusDetails() { + List inner = this.innerModel().statusDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List notificationsList() { + List inner = this.innerModel().notificationsList(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ConnectedRegistryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String connectedRegistryName; + + private ConnectedRegistryUpdateParameters updateConnectedRegistryUpdateParameters; + + public ConnectedRegistryImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public ConnectedRegistry create() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedRegistries() + .create(resourceGroupName, registryName, connectedRegistryName, this.innerModel(), Context.NONE); + return this; + } + + public ConnectedRegistry create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedRegistries() + .create(resourceGroupName, registryName, connectedRegistryName, this.innerModel(), context); + return this; + } + + ConnectedRegistryImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new ConnectedRegistryInner(); + this.serviceManager = serviceManager; + this.connectedRegistryName = name; + } + + public ConnectedRegistryImpl update() { + this.updateConnectedRegistryUpdateParameters = new ConnectedRegistryUpdateParameters(); + return this; + } + + public ConnectedRegistry apply() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedRegistries() + .update( + resourceGroupName, + registryName, + connectedRegistryName, + updateConnectedRegistryUpdateParameters, + Context.NONE); + return this; + } + + public ConnectedRegistry apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedRegistries() + .update( + resourceGroupName, + registryName, + connectedRegistryName, + updateConnectedRegistryUpdateParameters, + context); + return this; + } + + ConnectedRegistryImpl( + ConnectedRegistryInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.connectedRegistryName = Utils.getValueFromIdByName(innerObject.id(), "connectedRegistries"); + } + + public ConnectedRegistry refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedRegistries() + .getWithResponse(resourceGroupName, registryName, connectedRegistryName, Context.NONE) + .getValue(); + return this; + } + + public ConnectedRegistry refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectedRegistries() + .getWithResponse(resourceGroupName, registryName, connectedRegistryName, context) + .getValue(); + return this; + } + + public void deactivate() { + serviceManager.connectedRegistries().deactivate(resourceGroupName, registryName, connectedRegistryName); + } + + public void deactivate(Context context) { + serviceManager + .connectedRegistries() + .deactivate(resourceGroupName, registryName, connectedRegistryName, context); + } + + public ConnectedRegistryImpl withMode(ConnectedRegistryMode mode) { + this.innerModel().withMode(mode); + return this; + } + + public ConnectedRegistryImpl withParent(ParentProperties parent) { + this.innerModel().withParent(parent); + return this; + } + + public ConnectedRegistryImpl withClientTokenIds(List clientTokenIds) { + if (isInCreateMode()) { + this.innerModel().withClientTokenIds(clientTokenIds); + return this; + } else { + this.updateConnectedRegistryUpdateParameters.withClientTokenIds(clientTokenIds); + return this; + } + } + + public ConnectedRegistryImpl withLoginServer(LoginServerProperties loginServer) { + this.innerModel().withLoginServer(loginServer); + return this; + } + + public ConnectedRegistryImpl withLogging(LoggingProperties logging) { + if (isInCreateMode()) { + this.innerModel().withLogging(logging); + return this; + } else { + this.updateConnectedRegistryUpdateParameters.withLogging(logging); + return this; + } + } + + public ConnectedRegistryImpl withNotificationsList(List notificationsList) { + if (isInCreateMode()) { + this.innerModel().withNotificationsList(notificationsList); + return this; + } else { + this.updateConnectedRegistryUpdateParameters.withNotificationsList(notificationsList); + return this; + } + } + + public ConnectedRegistryImpl withSyncProperties(SyncUpdateProperties syncProperties) { + this.updateConnectedRegistryUpdateParameters.withSyncProperties(syncProperties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientBuilder.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientBuilder.java new file mode 100644 index 000000000000..cdeac88b66c3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the ContainerRegistryManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {ContainerRegistryManagementClientImpl.class}) +public final class ContainerRegistryManagementClientBuilder { + /* + * The Microsoft Azure subscription ID. + */ + private String subscriptionId; + + /** + * Sets The Microsoft Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the ContainerRegistryManagementClientBuilder. + */ + public ContainerRegistryManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ContainerRegistryManagementClientBuilder. + */ + public ContainerRegistryManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ContainerRegistryManagementClientBuilder. + */ + public ContainerRegistryManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ContainerRegistryManagementClientBuilder. + */ + public ContainerRegistryManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ContainerRegistryManagementClientBuilder. + */ + public ContainerRegistryManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ContainerRegistryManagementClientBuilder. + */ + public ContainerRegistryManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ContainerRegistryManagementClientImpl with the provided parameters. + * + * @return an instance of ContainerRegistryManagementClientImpl. + */ + public ContainerRegistryManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + ContainerRegistryManagementClientImpl client = + new ContainerRegistryManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientImpl.java new file mode 100644 index 000000000000..361ab5e0b8bf --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ContainerRegistryManagementClientImpl.java @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.containerregistry.generated.fluent.ConnectedRegistriesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.ContainerRegistryManagementClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.ExportPipelinesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.ImportPipelinesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.PipelineRunsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.RegistriesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.ReplicationsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.ScopeMapsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.TokensClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.WebhooksClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the ContainerRegistryManagementClientImpl type. */ +@ServiceClient(builder = ContainerRegistryManagementClientBuilder.class) +public final class ContainerRegistryManagementClientImpl implements ContainerRegistryManagementClient { + /** The Microsoft Azure subscription ID. */ + private final String subscriptionId; + + /** + * Gets The Microsoft Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The ConnectedRegistriesClient object to access its operations. */ + private final ConnectedRegistriesClient connectedRegistries; + + /** + * Gets the ConnectedRegistriesClient object to access its operations. + * + * @return the ConnectedRegistriesClient object. + */ + public ConnectedRegistriesClient getConnectedRegistries() { + return this.connectedRegistries; + } + + /** The ExportPipelinesClient object to access its operations. */ + private final ExportPipelinesClient exportPipelines; + + /** + * Gets the ExportPipelinesClient object to access its operations. + * + * @return the ExportPipelinesClient object. + */ + public ExportPipelinesClient getExportPipelines() { + return this.exportPipelines; + } + + /** The RegistriesClient object to access its operations. */ + private final RegistriesClient registries; + + /** + * Gets the RegistriesClient object to access its operations. + * + * @return the RegistriesClient object. + */ + public RegistriesClient getRegistries() { + return this.registries; + } + + /** The ImportPipelinesClient object to access its operations. */ + private final ImportPipelinesClient importPipelines; + + /** + * Gets the ImportPipelinesClient object to access its operations. + * + * @return the ImportPipelinesClient object. + */ + public ImportPipelinesClient getImportPipelines() { + return this.importPipelines; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The PipelineRunsClient object to access its operations. */ + private final PipelineRunsClient pipelineRuns; + + /** + * Gets the PipelineRunsClient object to access its operations. + * + * @return the PipelineRunsClient object. + */ + public PipelineRunsClient getPipelineRuns() { + return this.pipelineRuns; + } + + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The ReplicationsClient object to access its operations. */ + private final ReplicationsClient replications; + + /** + * Gets the ReplicationsClient object to access its operations. + * + * @return the ReplicationsClient object. + */ + public ReplicationsClient getReplications() { + return this.replications; + } + + /** The ScopeMapsClient object to access its operations. */ + private final ScopeMapsClient scopeMaps; + + /** + * Gets the ScopeMapsClient object to access its operations. + * + * @return the ScopeMapsClient object. + */ + public ScopeMapsClient getScopeMaps() { + return this.scopeMaps; + } + + /** The TokensClient object to access its operations. */ + private final TokensClient tokens; + + /** + * Gets the TokensClient object to access its operations. + * + * @return the TokensClient object. + */ + public TokensClient getTokens() { + return this.tokens; + } + + /** The WebhooksClient object to access its operations. */ + private final WebhooksClient webhooks; + + /** + * Gets the WebhooksClient object to access its operations. + * + * @return the WebhooksClient object. + */ + public WebhooksClient getWebhooks() { + return this.webhooks; + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The Microsoft Azure subscription ID. + * @param endpoint server parameter. + */ + ContainerRegistryManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2022-02-01-preview"; + this.connectedRegistries = new ConnectedRegistriesClientImpl(this); + this.exportPipelines = new ExportPipelinesClientImpl(this); + this.registries = new RegistriesClientImpl(this); + this.importPipelines = new ImportPipelinesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.pipelineRuns = new PipelineRunsClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.replications = new ReplicationsClientImpl(this); + this.scopeMaps = new ScopeMapsClientImpl(this); + this.tokens = new TokensClientImpl(this); + this.webhooks = new WebhooksClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerRegistryManagementClientImpl.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/EventImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/EventImpl.java new file mode 100644 index 000000000000..d13c7af2187b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/EventImpl.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInner; +import com.azure.resourcemanager.containerregistry.generated.models.Event; +import com.azure.resourcemanager.containerregistry.generated.models.EventRequestMessage; +import com.azure.resourcemanager.containerregistry.generated.models.EventResponseMessage; + +public final class EventImpl implements Event { + private EventInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + EventImpl( + EventInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public EventRequestMessage eventRequestMessage() { + return this.innerModel().eventRequestMessage(); + } + + public EventResponseMessage eventResponseMessage() { + return this.innerModel().eventResponseMessage(); + } + + public EventInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/EventInfoImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/EventInfoImpl.java new file mode 100644 index 000000000000..1115ba10c034 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/EventInfoImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInfoInner; +import com.azure.resourcemanager.containerregistry.generated.models.EventInfo; + +public final class EventInfoImpl implements EventInfo { + private EventInfoInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + EventInfoImpl( + EventInfoInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public EventInfoInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelineImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelineImpl.java new file mode 100644 index 000000000000..ce84fcc07aec --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelineImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ExportPipelineInner; +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipeline; +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipelineTargetProperties; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineOptions; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class ExportPipelineImpl implements ExportPipeline, ExportPipeline.Definition { + private ExportPipelineInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + ExportPipelineImpl( + ExportPipelineInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public IdentityProperties identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ExportPipelineTargetProperties target() { + return this.innerModel().target(); + } + + public List options() { + List inner = this.innerModel().options(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ExportPipelineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String exportPipelineName; + + public ExportPipelineImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public ExportPipeline create() { + this.innerObject = + serviceManager + .serviceClient() + .getExportPipelines() + .create(resourceGroupName, registryName, exportPipelineName, this.innerModel(), Context.NONE); + return this; + } + + public ExportPipeline create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExportPipelines() + .create(resourceGroupName, registryName, exportPipelineName, this.innerModel(), context); + return this; + } + + ExportPipelineImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new ExportPipelineInner(); + this.serviceManager = serviceManager; + this.exportPipelineName = name; + } + + public ExportPipeline refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExportPipelines() + .getWithResponse(resourceGroupName, registryName, exportPipelineName, Context.NONE) + .getValue(); + return this; + } + + public ExportPipeline refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExportPipelines() + .getWithResponse(resourceGroupName, registryName, exportPipelineName, context) + .getValue(); + return this; + } + + public ExportPipelineImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ExportPipelineImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ExportPipelineImpl withIdentity(IdentityProperties identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ExportPipelineImpl withTarget(ExportPipelineTargetProperties target) { + this.innerModel().withTarget(target); + return this; + } + + public ExportPipelineImpl withOptions(List options) { + this.innerModel().withOptions(options); + return this; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesClientImpl.java new file mode 100644 index 000000000000..dcc147d8743e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesClientImpl.java @@ -0,0 +1,1162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.ExportPipelinesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ExportPipelineInner; +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipelineListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExportPipelinesClient. */ +public final class ExportPipelinesClientImpl implements ExportPipelinesClient { + /** The proxy service used to perform REST calls. */ + private final ExportPipelinesService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ExportPipelinesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExportPipelinesClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(ExportPipelinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientExportPipelines to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface ExportPipelinesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/exportPipelines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/exportPipelines/{exportPipelineName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("exportPipelineName") String exportPipelineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/exportPipelines/{exportPipelineName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("exportPipelineName") String exportPipelineName, + @BodyParam("application/json") ExportPipelineInner exportPipelineCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/exportPipelines/{exportPipelineName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("exportPipelineName") String exportPipelineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all export pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all export pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all export pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all export pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all export pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all export pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String exportPipelineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (exportPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter exportPipelineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + exportPipelineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (exportPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter exportPipelineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + exportPipelineName, + accept, + context); + } + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String exportPipelineName) { + return getWithResponseAsync(resourceGroupName, registryName, exportPipelineName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExportPipelineInner get(String resourceGroupName, String registryName, String exportPipelineName) { + return getAsync(resourceGroupName, registryName, exportPipelineName).block(); + } + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, exportPipelineName, context).block(); + } + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (exportPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter exportPipelineName is required and cannot be null.")); + } + if (exportPipelineCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter exportPipelineCreateParameters is required and cannot be null.")); + } else { + exportPipelineCreateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + exportPipelineName, + exportPipelineCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (exportPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter exportPipelineName is required and cannot be null.")); + } + if (exportPipelineCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter exportPipelineCreateParameters is required and cannot be null.")); + } else { + exportPipelineCreateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + exportPipelineName, + exportPipelineCreateParameters, + accept, + context); + } + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExportPipelineInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters) { + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExportPipelineInner.class, + ExportPipelineInner.class, + this.client.getContext()); + } + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExportPipelineInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ExportPipelineInner.class, ExportPipelineInner.class, context); + } + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters) + .getSyncPoller(); + } + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents an export pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters, + Context context) { + return beginCreateAsync( + resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters, + Context context) { + return beginCreateAsync( + resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExportPipelineInner create( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters) { + return createAsync(resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters).block(); + } + + /** + * Creates an export pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param exportPipelineCreateParameters The parameters for creating an export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an export pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExportPipelineInner create( + String resourceGroupName, + String registryName, + String exportPipelineName, + ExportPipelineInner exportPipelineCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters, context) + .block(); + } + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String exportPipelineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (exportPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter exportPipelineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + exportPipelineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (exportPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter exportPipelineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + exportPipelineName, + accept, + context); + } + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String exportPipelineName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, exportPipelineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, exportPipelineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String exportPipelineName) { + return beginDeleteAsync(resourceGroupName, registryName, exportPipelineName).getSyncPoller(); + } + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, exportPipelineName, context).getSyncPoller(); + } + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String exportPipelineName) { + return beginDeleteAsync(resourceGroupName, registryName, exportPipelineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, exportPipelineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String exportPipelineName) { + deleteAsync(resourceGroupName, registryName, exportPipelineName).block(); + } + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String exportPipelineName, Context context) { + deleteAsync(resourceGroupName, registryName, exportPipelineName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesImpl.java new file mode 100644 index 000000000000..0a0c3414c917 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ExportPipelinesImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.ExportPipelinesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ExportPipelineInner; +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipeline; +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipelines; + +public final class ExportPipelinesImpl implements ExportPipelines { + private static final ClientLogger LOGGER = new ClientLogger(ExportPipelinesImpl.class); + + private final ExportPipelinesClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public ExportPipelinesImpl( + ExportPipelinesClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new ExportPipelineImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new ExportPipelineImpl(inner1, this.manager())); + } + + public ExportPipeline get(String resourceGroupName, String registryName, String exportPipelineName) { + ExportPipelineInner inner = this.serviceClient().get(resourceGroupName, registryName, exportPipelineName); + if (inner != null) { + return new ExportPipelineImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String exportPipelineName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, exportPipelineName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExportPipelineImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String exportPipelineName) { + this.serviceClient().delete(resourceGroupName, registryName, exportPipelineName); + } + + public void delete(String resourceGroupName, String registryName, String exportPipelineName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, exportPipelineName, context); + } + + public ExportPipeline getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String exportPipelineName = Utils.getValueFromIdByName(id, "exportPipelines"); + if (exportPipelineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'exportPipelines'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, exportPipelineName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String exportPipelineName = Utils.getValueFromIdByName(id, "exportPipelines"); + if (exportPipelineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'exportPipelines'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, exportPipelineName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String exportPipelineName = Utils.getValueFromIdByName(id, "exportPipelines"); + if (exportPipelineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'exportPipelines'.", id))); + } + this.delete(resourceGroupName, registryName, exportPipelineName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String exportPipelineName = Utils.getValueFromIdByName(id, "exportPipelines"); + if (exportPipelineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'exportPipelines'.", id))); + } + this.delete(resourceGroupName, registryName, exportPipelineName, context); + } + + private ExportPipelinesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public ExportPipelineImpl define(String name) { + return new ExportPipelineImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/GenerateCredentialsResultImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/GenerateCredentialsResultImpl.java new file mode 100644 index 000000000000..266be14982cb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/GenerateCredentialsResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.GenerateCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsResult; +import com.azure.resourcemanager.containerregistry.generated.models.TokenPassword; +import java.util.Collections; +import java.util.List; + +public final class GenerateCredentialsResultImpl implements GenerateCredentialsResult { + private GenerateCredentialsResultInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + GenerateCredentialsResultImpl( + GenerateCredentialsResultInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String username() { + return this.innerModel().username(); + } + + public List passwords() { + List inner = this.innerModel().passwords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public GenerateCredentialsResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelineImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelineImpl.java new file mode 100644 index 000000000000..b3e0ef996fc4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelineImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ImportPipelineInner; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipeline; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipelineSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineOptions; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineTriggerProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class ImportPipelineImpl implements ImportPipeline, ImportPipeline.Definition { + private ImportPipelineInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + ImportPipelineImpl( + ImportPipelineInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public IdentityProperties identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ImportPipelineSourceProperties source() { + return this.innerModel().source(); + } + + public PipelineTriggerProperties trigger() { + return this.innerModel().trigger(); + } + + public List options() { + List inner = this.innerModel().options(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ImportPipelineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String importPipelineName; + + public ImportPipelineImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public ImportPipeline create() { + this.innerObject = + serviceManager + .serviceClient() + .getImportPipelines() + .create(resourceGroupName, registryName, importPipelineName, this.innerModel(), Context.NONE); + return this; + } + + public ImportPipeline create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getImportPipelines() + .create(resourceGroupName, registryName, importPipelineName, this.innerModel(), context); + return this; + } + + ImportPipelineImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new ImportPipelineInner(); + this.serviceManager = serviceManager; + this.importPipelineName = name; + } + + public ImportPipeline refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getImportPipelines() + .getWithResponse(resourceGroupName, registryName, importPipelineName, Context.NONE) + .getValue(); + return this; + } + + public ImportPipeline refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getImportPipelines() + .getWithResponse(resourceGroupName, registryName, importPipelineName, context) + .getValue(); + return this; + } + + public ImportPipelineImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ImportPipelineImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ImportPipelineImpl withIdentity(IdentityProperties identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ImportPipelineImpl withSource(ImportPipelineSourceProperties source) { + this.innerModel().withSource(source); + return this; + } + + public ImportPipelineImpl withTrigger(PipelineTriggerProperties trigger) { + this.innerModel().withTrigger(trigger); + return this; + } + + public ImportPipelineImpl withOptions(List options) { + this.innerModel().withOptions(options); + return this; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesClientImpl.java new file mode 100644 index 000000000000..efb5e0f8aac4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesClientImpl.java @@ -0,0 +1,1162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.ImportPipelinesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ImportPipelineInner; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipelineListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ImportPipelinesClient. */ +public final class ImportPipelinesClientImpl implements ImportPipelinesClient { + /** The proxy service used to perform REST calls. */ + private final ImportPipelinesService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ImportPipelinesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ImportPipelinesClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(ImportPipelinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientImportPipelines to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface ImportPipelinesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/importPipelines") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/importPipelines/{importPipelineName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("importPipelineName") String importPipelineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/importPipelines/{importPipelineName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("importPipelineName") String importPipelineName, + @BodyParam("application/json") ImportPipelineInner importPipelineCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/importPipelines/{importPipelineName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("importPipelineName") String importPipelineName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all import pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all import pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all import pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all import pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all import pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all import pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String importPipelineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (importPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter importPipelineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + importPipelineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (importPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter importPipelineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + importPipelineName, + accept, + context); + } + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String importPipelineName) { + return getWithResponseAsync(resourceGroupName, registryName, importPipelineName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImportPipelineInner get(String resourceGroupName, String registryName, String importPipelineName) { + return getAsync(resourceGroupName, registryName, importPipelineName).block(); + } + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, importPipelineName, context).block(); + } + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (importPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter importPipelineName is required and cannot be null.")); + } + if (importPipelineCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter importPipelineCreateParameters is required and cannot be null.")); + } else { + importPipelineCreateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + importPipelineName, + importPipelineCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (importPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter importPipelineName is required and cannot be null.")); + } + if (importPipelineCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter importPipelineCreateParameters is required and cannot be null.")); + } else { + importPipelineCreateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + importPipelineName, + importPipelineCreateParameters, + accept, + context); + } + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents an import pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ImportPipelineInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters) { + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ImportPipelineInner.class, + ImportPipelineInner.class, + this.client.getContext()); + } + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents an import pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ImportPipelineInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ImportPipelineInner.class, ImportPipelineInner.class, context); + } + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents an import pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ImportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters) + .getSyncPoller(); + } + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents an import pipeline for a container + * registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ImportPipelineInner> beginCreate( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters, + Context context) { + return beginCreateAsync( + resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters, + Context context) { + return beginCreateAsync( + resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImportPipelineInner create( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters) { + return createAsync(resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters).block(); + } + + /** + * Creates an import pipeline for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param importPipelineCreateParameters The parameters for creating an import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents an import pipeline for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ImportPipelineInner create( + String resourceGroupName, + String registryName, + String importPipelineName, + ImportPipelineInner importPipelineCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters, context) + .block(); + } + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String importPipelineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (importPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter importPipelineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + importPipelineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (importPipelineName == null) { + return Mono + .error(new IllegalArgumentException("Parameter importPipelineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + importPipelineName, + accept, + context); + } + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String importPipelineName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, importPipelineName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, importPipelineName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String importPipelineName) { + return beginDeleteAsync(resourceGroupName, registryName, importPipelineName).getSyncPoller(); + } + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, importPipelineName, context).getSyncPoller(); + } + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String importPipelineName) { + return beginDeleteAsync(resourceGroupName, registryName, importPipelineName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, importPipelineName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String importPipelineName) { + deleteAsync(resourceGroupName, registryName, importPipelineName).block(); + } + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String importPipelineName, Context context) { + deleteAsync(resourceGroupName, registryName, importPipelineName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesImpl.java new file mode 100644 index 000000000000..93e150767944 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ImportPipelinesImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.ImportPipelinesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ImportPipelineInner; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipeline; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipelines; + +public final class ImportPipelinesImpl implements ImportPipelines { + private static final ClientLogger LOGGER = new ClientLogger(ImportPipelinesImpl.class); + + private final ImportPipelinesClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public ImportPipelinesImpl( + ImportPipelinesClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new ImportPipelineImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new ImportPipelineImpl(inner1, this.manager())); + } + + public ImportPipeline get(String resourceGroupName, String registryName, String importPipelineName) { + ImportPipelineInner inner = this.serviceClient().get(resourceGroupName, registryName, importPipelineName); + if (inner != null) { + return new ImportPipelineImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String importPipelineName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, importPipelineName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ImportPipelineImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String importPipelineName) { + this.serviceClient().delete(resourceGroupName, registryName, importPipelineName); + } + + public void delete(String resourceGroupName, String registryName, String importPipelineName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, importPipelineName, context); + } + + public ImportPipeline getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String importPipelineName = Utils.getValueFromIdByName(id, "importPipelines"); + if (importPipelineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'importPipelines'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, importPipelineName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String importPipelineName = Utils.getValueFromIdByName(id, "importPipelines"); + if (importPipelineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'importPipelines'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, importPipelineName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String importPipelineName = Utils.getValueFromIdByName(id, "importPipelines"); + if (importPipelineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'importPipelines'.", id))); + } + this.delete(resourceGroupName, registryName, importPipelineName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String importPipelineName = Utils.getValueFromIdByName(id, "importPipelines"); + if (importPipelineName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'importPipelines'.", id))); + } + this.delete(resourceGroupName, registryName, importPipelineName, context); + } + + private ImportPipelinesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public ImportPipelineImpl define(String name) { + return new ImportPipelineImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationDefinitionImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationDefinitionImpl.java new file mode 100644 index 000000000000..5deb72956300 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationDefinitionImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.OperationDefinitionInner; +import com.azure.resourcemanager.containerregistry.generated.models.OperationDefinition; +import com.azure.resourcemanager.containerregistry.generated.models.OperationDisplayDefinition; +import com.azure.resourcemanager.containerregistry.generated.models.OperationServiceSpecificationDefinition; + +public final class OperationDefinitionImpl implements OperationDefinition { + private OperationDefinitionInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + OperationDefinitionImpl( + OperationDefinitionInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String origin() { + return this.innerModel().origin(); + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplayDefinition display() { + return this.innerModel().display(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationServiceSpecificationDefinition serviceSpecification() { + return this.innerModel().serviceSpecification(); + } + + public OperationDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..89f9076e4a5d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.containerregistry.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.OperationDefinitionInner; +import com.azure.resourcemanager.containerregistry.generated.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ContainerRegistry/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsImpl.java new file mode 100644 index 000000000000..2dd610821aca --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.OperationDefinitionInner; +import com.azure.resourcemanager.containerregistry.generated.models.OperationDefinition; +import com.azure.resourcemanager.containerregistry.generated.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationDefinitionImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationDefinitionImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunImpl.java new file mode 100644 index 000000000000..7c2a28b993ec --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunImpl.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PipelineRunInner; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRun; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunResponse; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; + +public final class PipelineRunImpl implements PipelineRun, PipelineRun.Definition { + private PipelineRunInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + PipelineRunImpl( + PipelineRunInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PipelineRunRequest request() { + return this.innerModel().request(); + } + + public PipelineRunResponse response() { + return this.innerModel().response(); + } + + public String forceUpdateTag() { + return this.innerModel().forceUpdateTag(); + } + + public PipelineRunInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String pipelineRunName; + + public PipelineRunImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public PipelineRun create() { + this.innerObject = + serviceManager + .serviceClient() + .getPipelineRuns() + .create(resourceGroupName, registryName, pipelineRunName, this.innerModel(), Context.NONE); + return this; + } + + public PipelineRun create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPipelineRuns() + .create(resourceGroupName, registryName, pipelineRunName, this.innerModel(), context); + return this; + } + + PipelineRunImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new PipelineRunInner(); + this.serviceManager = serviceManager; + this.pipelineRunName = name; + } + + public PipelineRun refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPipelineRuns() + .getWithResponse(resourceGroupName, registryName, pipelineRunName, Context.NONE) + .getValue(); + return this; + } + + public PipelineRun refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPipelineRuns() + .getWithResponse(resourceGroupName, registryName, pipelineRunName, context) + .getValue(); + return this; + } + + public PipelineRunImpl withRequest(PipelineRunRequest request) { + this.innerModel().withRequest(request); + return this; + } + + public PipelineRunImpl withForceUpdateTag(String forceUpdateTag) { + this.innerModel().withForceUpdateTag(forceUpdateTag); + return this; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsClientImpl.java new file mode 100644 index 000000000000..603d63d63bfa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsClientImpl.java @@ -0,0 +1,1153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.PipelineRunsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PipelineRunInner; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PipelineRunsClient. */ +public final class PipelineRunsClientImpl implements PipelineRunsClient { + /** The proxy service used to perform REST calls. */ + private final PipelineRunsService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of PipelineRunsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PipelineRunsClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(PipelineRunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientPipelineRuns to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface PipelineRunsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/pipelineRuns") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/pipelineRuns/{pipelineRunName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("pipelineRunName") String pipelineRunName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/pipelineRuns/{pipelineRunName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("pipelineRunName") String pipelineRunName, + @BodyParam("application/json") PipelineRunInner pipelineRunCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/pipelineRuns/{pipelineRunName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("pipelineRunName") String pipelineRunName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the pipeline runs for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the pipeline runs for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the pipeline runs for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the pipeline runs for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the pipeline runs for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all the pipeline runs for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String pipelineRunName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (pipelineRunName == null) { + return Mono + .error(new IllegalArgumentException("Parameter pipelineRunName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + pipelineRunName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (pipelineRunName == null) { + return Mono + .error(new IllegalArgumentException("Parameter pipelineRunName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + pipelineRunName, + accept, + context); + } + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String pipelineRunName) { + return getWithResponseAsync(resourceGroupName, registryName, pipelineRunName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PipelineRunInner get(String resourceGroupName, String registryName, String pipelineRunName) { + return getAsync(resourceGroupName, registryName, pipelineRunName).block(); + } + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, pipelineRunName, context).block(); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (pipelineRunName == null) { + return Mono + .error(new IllegalArgumentException("Parameter pipelineRunName is required and cannot be null.")); + } + if (pipelineRunCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter pipelineRunCreateParameters is required and cannot be null.")); + } else { + pipelineRunCreateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + pipelineRunName, + pipelineRunCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (pipelineRunName == null) { + return Mono + .error(new IllegalArgumentException("Parameter pipelineRunName is required and cannot be null.")); + } + if (pipelineRunCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter pipelineRunCreateParameters is required and cannot be null.")); + } else { + pipelineRunCreateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + pipelineRunName, + pipelineRunCreateParameters, + accept, + context); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PipelineRunInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PipelineRunInner.class, + PipelineRunInner.class, + this.client.getContext()); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PipelineRunInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PipelineRunInner.class, PipelineRunInner.class, context); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PipelineRunInner> beginCreate( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters) + .getSyncPoller(); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PipelineRunInner> beginCreate( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PipelineRunInner create( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters) { + return createAsync(resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters).block(); + } + + /** + * Creates a pipeline run for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param pipelineRunCreateParameters The parameters for creating a pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a pipeline run for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PipelineRunInner create( + String resourceGroupName, + String registryName, + String pipelineRunName, + PipelineRunInner pipelineRunCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters, context) + .block(); + } + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String pipelineRunName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (pipelineRunName == null) { + return Mono + .error(new IllegalArgumentException("Parameter pipelineRunName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + pipelineRunName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (pipelineRunName == null) { + return Mono + .error(new IllegalArgumentException("Parameter pipelineRunName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + pipelineRunName, + accept, + context); + } + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String pipelineRunName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, pipelineRunName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, pipelineRunName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String pipelineRunName) { + return beginDeleteAsync(resourceGroupName, registryName, pipelineRunName).getSyncPoller(); + } + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, pipelineRunName, context).getSyncPoller(); + } + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String pipelineRunName) { + return beginDeleteAsync(resourceGroupName, registryName, pipelineRunName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, pipelineRunName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String pipelineRunName) { + deleteAsync(resourceGroupName, registryName, pipelineRunName).block(); + } + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String pipelineRunName, Context context) { + deleteAsync(resourceGroupName, registryName, pipelineRunName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsImpl.java new file mode 100644 index 000000000000..d0d15bdb0f24 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PipelineRunsImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.PipelineRunsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PipelineRunInner; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRun; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRuns; + +public final class PipelineRunsImpl implements PipelineRuns { + private static final ClientLogger LOGGER = new ClientLogger(PipelineRunsImpl.class); + + private final PipelineRunsClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public PipelineRunsImpl( + PipelineRunsClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new PipelineRunImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new PipelineRunImpl(inner1, this.manager())); + } + + public PipelineRun get(String resourceGroupName, String registryName, String pipelineRunName) { + PipelineRunInner inner = this.serviceClient().get(resourceGroupName, registryName, pipelineRunName); + if (inner != null) { + return new PipelineRunImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String pipelineRunName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, pipelineRunName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PipelineRunImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String pipelineRunName) { + this.serviceClient().delete(resourceGroupName, registryName, pipelineRunName); + } + + public void delete(String resourceGroupName, String registryName, String pipelineRunName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, pipelineRunName, context); + } + + public PipelineRun getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String pipelineRunName = Utils.getValueFromIdByName(id, "pipelineRuns"); + if (pipelineRunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pipelineRuns'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, pipelineRunName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String pipelineRunName = Utils.getValueFromIdByName(id, "pipelineRuns"); + if (pipelineRunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pipelineRuns'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, pipelineRunName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String pipelineRunName = Utils.getValueFromIdByName(id, "pipelineRuns"); + if (pipelineRunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pipelineRuns'.", id))); + } + this.delete(resourceGroupName, registryName, pipelineRunName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String pipelineRunName = Utils.getValueFromIdByName(id, "pipelineRuns"); + if (pipelineRunName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pipelineRuns'.", id))); + } + this.delete(resourceGroupName, registryName, pipelineRunName, context); + } + + private PipelineRunsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public PipelineRunImpl define(String name) { + return new PipelineRunImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..871145a7b5fd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, registryName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, registryName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnectionImpl update() { + return this; + } + + public PrivateEndpointConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, registryName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate( + resourceGroupName, registryName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.privateEndpointConnectionName = Utils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, registryName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, registryName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..df641a10b8c2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpointConnectionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientPrivateEndpointConnections to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnection, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, registryName, privateEndpointConnectionName).block(); + } + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName, context).block(); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (privateEndpointConnection == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnection is required and cannot be null.")); + } else { + privateEndpointConnection.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + privateEndpointConnectionName, + privateEndpointConnection, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (privateEndpointConnection == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnection is required and cannot be null.")); + } else { + privateEndpointConnection.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + privateEndpointConnectionName, + privateEndpointConnection, + accept, + context); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a private endpoint connection for a + * container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + this.client.getContext()); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a private endpoint connection for a + * container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + context); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a private endpoint connection for a + * container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return beginCreateOrUpdateAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection) + .getSyncPoller(); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a private endpoint connection for a + * container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection, context) + .getSyncPoller(); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return beginCreateOrUpdateAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return createOrUpdateAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection) + .block(); + } + + /** + * Update the state of specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a private endpoint connection for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate( + String resourceGroupName, + String registryName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return createOrUpdateAsync( + resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection, context) + .block(); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + privateEndpointConnectionName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + privateEndpointConnectionName, + context); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, registryName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, registryName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, registryName, privateEndpointConnectionName).block(); + } + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, registryName, privateEndpointConnectionName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..b8d5744d9045 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpointConnections; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String registryName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection get( + String resourceGroupName, String registryName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, registryName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, registryName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, registryName, privateEndpointConnectionName); + } + + public void delete( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, privateEndpointConnectionName, context); + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, registryName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, registryName, privateEndpointConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, registryName, privateEndpointConnectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, registryName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateLinkResourceImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..b7d6bfa74996 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + PrivateLinkResourceImpl( + PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String type() { + return this.innerModel().type(); + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesClientImpl.java new file mode 100644 index 000000000000..c1bcfb97bf1e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesClientImpl.java @@ -0,0 +1,3334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.RegistriesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.GenerateCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryListCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryNameStatusInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryUsageListResultInner; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsParameters; +import com.azure.resourcemanager.containerregistry.generated.models.ImportImageParameters; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.containerregistry.generated.models.RegenerateCredentialParameters; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryListResult; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryNameCheckRequest; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RegistriesClient. */ +public final class RegistriesClientImpl implements RegistriesClient { + /** The proxy service used to perform REST calls. */ + private final RegistriesService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of RegistriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistriesClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(RegistriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientRegistries to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface RegistriesService { + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/importImage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> importImage( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @BodyParam("application/json") ImportImageParameters parameters, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") RegistryNameCheckRequest registryNameCheckRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @BodyParam("application/json") RegistryInner registry, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @BodyParam("application/json") RegistryUpdateParameters registryUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/listUsages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listUsages( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPrivateLinkResources( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/privateLinkResources/{groupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getPrivateLinkResource( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("groupName") String groupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/listCredentials") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCredentials( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/regenerateCredential") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateCredential( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @BodyParam("application/json") RegenerateCredentialParameters regenerateCredentialParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/generateCredentials") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateCredentials( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @BodyParam("application/json") GenerateCredentialsParameters generateCredentialsParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPrivateLinkResourcesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> importImageWithResponseAsync( + String resourceGroupName, String registryName, ImportImageParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + return FluxUtil + .withContext( + context -> + service + .importImage( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> importImageWithResponseAsync( + String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + context = this.client.mergeContext(context); + return service + .importImage( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + parameters, + context); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginImportImageAsync( + String resourceGroupName, String registryName, ImportImageParameters parameters) { + Mono>> mono = + importImageWithResponseAsync(resourceGroupName, registryName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginImportImageAsync( + String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + importImageWithResponseAsync(resourceGroupName, registryName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginImportImage( + String resourceGroupName, String registryName, ImportImageParameters parameters) { + return beginImportImageAsync(resourceGroupName, registryName, parameters).getSyncPoller(); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginImportImage( + String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { + return beginImportImageAsync(resourceGroupName, registryName, parameters, context).getSyncPoller(); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono importImageAsync( + String resourceGroupName, String registryName, ImportImageParameters parameters) { + return beginImportImageAsync(resourceGroupName, registryName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono importImageAsync( + String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { + return beginImportImageAsync(resourceGroupName, registryName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters) { + importImageAsync(resourceGroupName, registryName, parameters).block(); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void importImage( + String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { + importImageAsync(resourceGroupName, registryName, parameters, context).block(); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric + * characters, be globally unique, and between 5 and 50 characters in length. + * + * @param registryNameCheckRequest The object containing information for the availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + RegistryNameCheckRequest registryNameCheckRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (registryNameCheckRequest == null) { + return Mono + .error( + new IllegalArgumentException("Parameter registryNameCheckRequest is required and cannot be null.")); + } else { + registryNameCheckRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + registryNameCheckRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric + * characters, be globally unique, and between 5 and 50 characters in length. + * + * @param registryNameCheckRequest The object containing information for the availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + RegistryNameCheckRequest registryNameCheckRequest, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (registryNameCheckRequest == null) { + return Mono + .error( + new IllegalArgumentException("Parameter registryNameCheckRequest is required and cannot be null.")); + } else { + registryNameCheckRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + registryNameCheckRequest, + accept, + context); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric + * characters, be globally unique, and between 5 and 50 characters in length. + * + * @param registryNameCheckRequest The object containing information for the availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + RegistryNameCheckRequest registryNameCheckRequest) { + return checkNameAvailabilityWithResponseAsync(registryNameCheckRequest) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric + * characters, be globally unique, and between 5 and 50 characters in length. + * + * @param registryNameCheckRequest The object containing information for the availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryNameStatusInner checkNameAvailability(RegistryNameCheckRequest registryNameCheckRequest) { + return checkNameAvailabilityAsync(registryNameCheckRequest).block(); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric + * characters, be globally unique, and between 5 and 50 characters in length. + * + * @param registryNameCheckRequest The object containing information for the availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + RegistryNameCheckRequest registryNameCheckRequest, Context context) { + return checkNameAvailabilityWithResponseAsync(registryNameCheckRequest, context).block(); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String registryName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, registryName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner getByResourceGroup(String resourceGroupName, String registryName) { + return getByResourceGroupAsync(resourceGroupName, registryName).block(); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String registryName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, registryName, context).block(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String registryName, RegistryInner registry) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (registry == null) { + return Mono.error(new IllegalArgumentException("Parameter registry is required and cannot be null.")); + } else { + registry.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + registry, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String registryName, RegistryInner registry, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (registry == null) { + return Mono.error(new IllegalArgumentException("Parameter registry is required and cannot be null.")); + } else { + registry.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + registry, + accept, + context); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RegistryInner> beginCreateAsync( + String resourceGroupName, String registryName, RegistryInner registry) { + Mono>> mono = createWithResponseAsync(resourceGroupName, registryName, registry); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RegistryInner.class, + RegistryInner.class, + this.client.getContext()); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RegistryInner> beginCreateAsync( + String resourceGroupName, String registryName, RegistryInner registry, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, registry, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RegistryInner.class, RegistryInner.class, context); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginCreate( + String resourceGroupName, String registryName, RegistryInner registry) { + return beginCreateAsync(resourceGroupName, registryName, registry).getSyncPoller(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginCreate( + String resourceGroupName, String registryName, RegistryInner registry, Context context) { + return beginCreateAsync(resourceGroupName, registryName, registry, context).getSyncPoller(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String registryName, RegistryInner registry) { + return beginCreateAsync(resourceGroupName, registryName, registry) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String registryName, RegistryInner registry, Context context) { + return beginCreateAsync(resourceGroupName, registryName, registry, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner create(String resourceGroupName, String registryName, RegistryInner registry) { + return createAsync(resourceGroupName, registryName, registry).block(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner create( + String resourceGroupName, String registryName, RegistryInner registry, Context context) { + return createAsync(resourceGroupName, registryName, registry, context).block(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + context); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName) { + return beginDeleteAsync(resourceGroupName, registryName).getSyncPoller(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, context).getSyncPoller(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName) { + return beginDeleteAsync(resourceGroupName, registryName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName) { + deleteAsync(resourceGroupName, registryName).block(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, Context context) { + deleteAsync(resourceGroupName, registryName, context).block(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (registryUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null.")); + } else { + registryUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + registryUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + RegistryUpdateParameters registryUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (registryUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null.")); + } else { + registryUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + registryUpdateParameters, + accept, + context); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RegistryInner> beginUpdateAsync( + String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, registryUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RegistryInner.class, + RegistryInner.class, + this.client.getContext()); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RegistryInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + RegistryUpdateParameters registryUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, registryUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RegistryInner.class, RegistryInner.class, context); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginUpdate( + String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, registryUpdateParameters).getSyncPoller(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RegistryInner> beginUpdate( + String resourceGroupName, + String registryName, + RegistryUpdateParameters registryUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, registryUpdateParameters, context).getSyncPoller(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, registryUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + RegistryUpdateParameters registryUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, registryUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner update( + String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateAsync(resourceGroupName, registryName, registryUpdateParameters).block(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryInner update( + String resourceGroupName, + String registryName, + RegistryUpdateParameters registryUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, registryUpdateParameters, context).block(); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsagesWithResponseAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listUsages( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsagesWithResponseAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listUsages( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listUsagesAsync(String resourceGroupName, String registryName) { + return listUsagesWithResponseAsync(resourceGroupName, registryName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryUsageListResultInner listUsages(String resourceGroupName, String registryName) { + return listUsagesAsync(resourceGroupName, registryName).block(); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listUsagesWithResponse( + String resourceGroupName, String registryName, Context context) { + return listUsagesWithResponseAsync(resourceGroupName, registryName, context).block(); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateLinkResourcesSinglePageAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listPrivateLinkResources( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateLinkResourcesSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listPrivateLinkResources( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPrivateLinkResourcesAsync( + String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listPrivateLinkResourcesSinglePageAsync(resourceGroupName, registryName), + nextLink -> listPrivateLinkResourcesNextSinglePageAsync(nextLink)); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPrivateLinkResourcesAsync( + String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listPrivateLinkResourcesSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listPrivateLinkResourcesNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPrivateLinkResources( + String resourceGroupName, String registryName) { + return new PagedIterable<>(listPrivateLinkResourcesAsync(resourceGroupName, registryName)); + } + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPrivateLinkResources( + String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listPrivateLinkResourcesAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPrivateLinkResourceWithResponseAsync( + String resourceGroupName, String registryName, String groupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getPrivateLinkResource( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + groupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPrivateLinkResourceWithResponseAsync( + String resourceGroupName, String registryName, String groupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getPrivateLinkResource( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + groupName, + accept, + context); + } + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPrivateLinkResourceAsync( + String resourceGroupName, String registryName, String groupName) { + return getPrivateLinkResourceWithResponseAsync(resourceGroupName, registryName, groupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner getPrivateLinkResource( + String resourceGroupName, String registryName, String groupName) { + return getPrivateLinkResourceAsync(resourceGroupName, registryName, groupName).block(); + } + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPrivateLinkResourceWithResponse( + String resourceGroupName, String registryName, String groupName, Context context) { + return getPrivateLinkResourceWithResponseAsync(resourceGroupName, registryName, groupName, context).block(); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCredentialsWithResponseAsync( + String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listCredentials( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCredentialsWithResponseAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCredentials( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listCredentialsAsync( + String resourceGroupName, String registryName) { + return listCredentialsWithResponseAsync(resourceGroupName, registryName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryListCredentialsResultInner listCredentials(String resourceGroupName, String registryName) { + return listCredentialsAsync(resourceGroupName, registryName).block(); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listCredentialsWithResponse( + String resourceGroupName, String registryName, Context context) { + return listCredentialsWithResponseAsync(resourceGroupName, registryName, context).block(); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateCredentialWithResponseAsync( + String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (regenerateCredentialParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter regenerateCredentialParameters is required and cannot be null.")); + } else { + regenerateCredentialParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateCredential( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + regenerateCredentialParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateCredentialWithResponseAsync( + String resourceGroupName, + String registryName, + RegenerateCredentialParameters regenerateCredentialParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (regenerateCredentialParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter regenerateCredentialParameters is required and cannot be null.")); + } else { + regenerateCredentialParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateCredential( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + regenerateCredentialParameters, + accept, + context); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateCredentialAsync( + String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters) { + return regenerateCredentialWithResponseAsync(resourceGroupName, registryName, regenerateCredentialParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegistryListCredentialsResultInner regenerateCredential( + String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters) { + return regenerateCredentialAsync(resourceGroupName, registryName, regenerateCredentialParameters).block(); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateCredentialWithResponse( + String resourceGroupName, + String registryName, + RegenerateCredentialParameters regenerateCredentialParameters, + Context context) { + return regenerateCredentialWithResponseAsync( + resourceGroupName, registryName, regenerateCredentialParameters, context) + .block(); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateCredentialsWithResponseAsync( + String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (generateCredentialsParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter generateCredentialsParameters is required and cannot be null.")); + } else { + generateCredentialsParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateCredentials( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + generateCredentialsParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateCredentialsWithResponseAsync( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (generateCredentialsParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter generateCredentialsParameters is required and cannot be null.")); + } else { + generateCredentialsParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateCredentials( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + generateCredentialsParameters, + accept, + context); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GenerateCredentialsResultInner> + beginGenerateCredentialsAsync( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters) { + Mono>> mono = + generateCredentialsWithResponseAsync(resourceGroupName, registryName, generateCredentialsParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GenerateCredentialsResultInner.class, + GenerateCredentialsResultInner.class, + this.client.getContext()); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GenerateCredentialsResultInner> + beginGenerateCredentialsAsync( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + generateCredentialsWithResponseAsync( + resourceGroupName, registryName, generateCredentialsParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GenerateCredentialsResultInner.class, + GenerateCredentialsResultInner.class, + context); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GenerateCredentialsResultInner> + beginGenerateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters) { + return beginGenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters) + .getSyncPoller(); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GenerateCredentialsResultInner> + beginGenerateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context) { + return beginGenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters, context) + .getSyncPoller(); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateCredentialsAsync( + String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters) { + return beginGenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateCredentialsAsync( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context) { + return beginGenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenerateCredentialsResultInner generateCredentials( + String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters) { + return generateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters).block(); + } + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenerateCredentialsResultInner generateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context) { + return generateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateLinkResourcesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listPrivateLinkResourcesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPrivateLinkResourcesNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listPrivateLinkResourcesNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesImpl.java new file mode 100644 index 000000000000..1b79b542a930 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistriesImpl.java @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.RegistriesClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.GenerateCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryListCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryNameStatusInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryUsageListResultInner; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsParameters; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsResult; +import com.azure.resourcemanager.containerregistry.generated.models.ImportImageParameters; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.containerregistry.generated.models.RegenerateCredentialParameters; +import com.azure.resourcemanager.containerregistry.generated.models.Registries; +import com.azure.resourcemanager.containerregistry.generated.models.Registry; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryListCredentialsResult; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryNameCheckRequest; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryNameStatus; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryUsageListResult; + +public final class RegistriesImpl implements Registries { + private static final ClientLogger LOGGER = new ClientLogger(RegistriesImpl.class); + + private final RegistriesClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public RegistriesImpl( + RegistriesClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters) { + this.serviceClient().importImage(resourceGroupName, registryName, parameters); + } + + public void importImage( + String resourceGroupName, String registryName, ImportImageParameters parameters, Context context) { + this.serviceClient().importImage(resourceGroupName, registryName, parameters, context); + } + + public RegistryNameStatus checkNameAvailability(RegistryNameCheckRequest registryNameCheckRequest) { + RegistryNameStatusInner inner = this.serviceClient().checkNameAvailability(registryNameCheckRequest); + if (inner != null) { + return new RegistryNameStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + RegistryNameCheckRequest registryNameCheckRequest, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(registryNameCheckRequest, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RegistryNameStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new RegistryImpl(inner1, this.manager())); + } + + public Registry getByResourceGroup(String resourceGroupName, String registryName) { + RegistryInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, registryName); + if (inner != null) { + return new RegistryImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String registryName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, registryName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RegistryImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String registryName) { + this.serviceClient().delete(resourceGroupName, registryName); + } + + public void delete(String resourceGroupName, String registryName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, context); + } + + public RegistryUsageListResult listUsages(String resourceGroupName, String registryName) { + RegistryUsageListResultInner inner = this.serviceClient().listUsages(resourceGroupName, registryName); + if (inner != null) { + return new RegistryUsageListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listUsagesWithResponse( + String resourceGroupName, String registryName, Context context) { + Response inner = + this.serviceClient().listUsagesWithResponse(resourceGroupName, registryName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RegistryUsageListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listPrivateLinkResources(String resourceGroupName, String registryName) { + PagedIterable inner = + this.serviceClient().listPrivateLinkResources(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable listPrivateLinkResources( + String resourceGroupName, String registryName, Context context) { + PagedIterable inner = + this.serviceClient().listPrivateLinkResources(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PrivateLinkResource getPrivateLinkResource(String resourceGroupName, String registryName, String groupName) { + PrivateLinkResourceInner inner = + this.serviceClient().getPrivateLinkResource(resourceGroupName, registryName, groupName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getPrivateLinkResourceWithResponse( + String resourceGroupName, String registryName, String groupName, Context context) { + Response inner = + this + .serviceClient() + .getPrivateLinkResourceWithResponse(resourceGroupName, registryName, groupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RegistryListCredentialsResult listCredentials(String resourceGroupName, String registryName) { + RegistryListCredentialsResultInner inner = + this.serviceClient().listCredentials(resourceGroupName, registryName); + if (inner != null) { + return new RegistryListCredentialsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listCredentialsWithResponse( + String resourceGroupName, String registryName, Context context) { + Response inner = + this.serviceClient().listCredentialsWithResponse(resourceGroupName, registryName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RegistryListCredentialsResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RegistryListCredentialsResult regenerateCredential( + String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters) { + RegistryListCredentialsResultInner inner = + this.serviceClient().regenerateCredential(resourceGroupName, registryName, regenerateCredentialParameters); + if (inner != null) { + return new RegistryListCredentialsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateCredentialWithResponse( + String resourceGroupName, + String registryName, + RegenerateCredentialParameters regenerateCredentialParameters, + Context context) { + Response inner = + this + .serviceClient() + .regenerateCredentialWithResponse( + resourceGroupName, registryName, regenerateCredentialParameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RegistryListCredentialsResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GenerateCredentialsResult generateCredentials( + String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters) { + GenerateCredentialsResultInner inner = + this.serviceClient().generateCredentials(resourceGroupName, registryName, generateCredentialsParameters); + if (inner != null) { + return new GenerateCredentialsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public GenerateCredentialsResult generateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context) { + GenerateCredentialsResultInner inner = + this + .serviceClient() + .generateCredentials(resourceGroupName, registryName, generateCredentialsParameters, context); + if (inner != null) { + return new GenerateCredentialsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Registry getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, registryName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + this.delete(resourceGroupName, registryName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + this.delete(resourceGroupName, registryName, context); + } + + private RegistriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public RegistryImpl define(String name) { + return new RegistryImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryImpl.java new file mode 100644 index 000000000000..2fbed105cc29 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryImpl.java @@ -0,0 +1,429 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryInner; +import com.azure.resourcemanager.containerregistry.generated.models.EncryptionProperty; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsParameters; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsResult; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ImportImageParameters; +import com.azure.resourcemanager.containerregistry.generated.models.NetworkRuleBypassOptions; +import com.azure.resourcemanager.containerregistry.generated.models.NetworkRuleSet; +import com.azure.resourcemanager.containerregistry.generated.models.Policies; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.containerregistry.generated.models.RegenerateCredentialParameters; +import com.azure.resourcemanager.containerregistry.generated.models.Registry; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryListCredentialsResult; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.Sku; +import com.azure.resourcemanager.containerregistry.generated.models.Status; +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class RegistryImpl implements Registry, Registry.Definition, Registry.Update { + private RegistryInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public IdentityProperties identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String loginServer() { + return this.innerModel().loginServer(); + } + + public OffsetDateTime creationDate() { + return this.innerModel().creationDate(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Status status() { + return this.innerModel().status(); + } + + public Boolean adminUserEnabled() { + return this.innerModel().adminUserEnabled(); + } + + public NetworkRuleSet networkRuleSet() { + return this.innerModel().networkRuleSet(); + } + + public Policies policies() { + return this.innerModel().policies(); + } + + public EncryptionProperty encryption() { + return this.innerModel().encryption(); + } + + public Boolean dataEndpointEnabled() { + return this.innerModel().dataEndpointEnabled(); + } + + public List dataEndpointHostNames() { + List inner = this.innerModel().dataEndpointHostNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public NetworkRuleBypassOptions networkRuleBypassOptions() { + return this.innerModel().networkRuleBypassOptions(); + } + + public ZoneRedundancy zoneRedundancy() { + return this.innerModel().zoneRedundancy(); + } + + public Boolean anonymousPullEnabled() { + return this.innerModel().anonymousPullEnabled(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public RegistryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private RegistryUpdateParameters updateRegistryUpdateParameters; + + public RegistryImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Registry create() { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .create(resourceGroupName, registryName, this.innerModel(), Context.NONE); + return this; + } + + public Registry create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .create(resourceGroupName, registryName, this.innerModel(), context); + return this; + } + + RegistryImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new RegistryInner(); + this.serviceManager = serviceManager; + this.registryName = name; + } + + public RegistryImpl update() { + this.updateRegistryUpdateParameters = new RegistryUpdateParameters(); + return this; + } + + public Registry apply() { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .update(resourceGroupName, registryName, updateRegistryUpdateParameters, Context.NONE); + return this; + } + + public Registry apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .update(resourceGroupName, registryName, updateRegistryUpdateParameters, context); + return this; + } + + RegistryImpl( + RegistryInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + } + + public Registry refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .getByResourceGroupWithResponse(resourceGroupName, registryName, Context.NONE) + .getValue(); + return this; + } + + public Registry refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRegistries() + .getByResourceGroupWithResponse(resourceGroupName, registryName, context) + .getValue(); + return this; + } + + public void importImage(ImportImageParameters parameters) { + serviceManager.registries().importImage(resourceGroupName, registryName, parameters); + } + + public void importImage(ImportImageParameters parameters, Context context) { + serviceManager.registries().importImage(resourceGroupName, registryName, parameters, context); + } + + public RegistryListCredentialsResult listCredentials() { + return serviceManager.registries().listCredentials(resourceGroupName, registryName); + } + + public Response listCredentialsWithResponse(Context context) { + return serviceManager.registries().listCredentialsWithResponse(resourceGroupName, registryName, context); + } + + public RegistryListCredentialsResult regenerateCredential( + RegenerateCredentialParameters regenerateCredentialParameters) { + return serviceManager + .registries() + .regenerateCredential(resourceGroupName, registryName, regenerateCredentialParameters); + } + + public Response regenerateCredentialWithResponse( + RegenerateCredentialParameters regenerateCredentialParameters, Context context) { + return serviceManager + .registries() + .regenerateCredentialWithResponse(resourceGroupName, registryName, regenerateCredentialParameters, context); + } + + public GenerateCredentialsResult generateCredentials(GenerateCredentialsParameters generateCredentialsParameters) { + return serviceManager + .registries() + .generateCredentials(resourceGroupName, registryName, generateCredentialsParameters); + } + + public GenerateCredentialsResult generateCredentials( + GenerateCredentialsParameters generateCredentialsParameters, Context context) { + return serviceManager + .registries() + .generateCredentials(resourceGroupName, registryName, generateCredentialsParameters, context); + } + + public RegistryImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public RegistryImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public RegistryImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateRegistryUpdateParameters.withSku(sku); + return this; + } + } + + public RegistryImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateRegistryUpdateParameters.withTags(tags); + return this; + } + } + + public RegistryImpl withIdentity(IdentityProperties identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateRegistryUpdateParameters.withIdentity(identity); + return this; + } + } + + public RegistryImpl withAdminUserEnabled(Boolean adminUserEnabled) { + if (isInCreateMode()) { + this.innerModel().withAdminUserEnabled(adminUserEnabled); + return this; + } else { + this.updateRegistryUpdateParameters.withAdminUserEnabled(adminUserEnabled); + return this; + } + } + + public RegistryImpl withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + if (isInCreateMode()) { + this.innerModel().withNetworkRuleSet(networkRuleSet); + return this; + } else { + this.updateRegistryUpdateParameters.withNetworkRuleSet(networkRuleSet); + return this; + } + } + + public RegistryImpl withPolicies(Policies policies) { + if (isInCreateMode()) { + this.innerModel().withPolicies(policies); + return this; + } else { + this.updateRegistryUpdateParameters.withPolicies(policies); + return this; + } + } + + public RegistryImpl withEncryption(EncryptionProperty encryption) { + if (isInCreateMode()) { + this.innerModel().withEncryption(encryption); + return this; + } else { + this.updateRegistryUpdateParameters.withEncryption(encryption); + return this; + } + } + + public RegistryImpl withDataEndpointEnabled(Boolean dataEndpointEnabled) { + if (isInCreateMode()) { + this.innerModel().withDataEndpointEnabled(dataEndpointEnabled); + return this; + } else { + this.updateRegistryUpdateParameters.withDataEndpointEnabled(dataEndpointEnabled); + return this; + } + } + + public RegistryImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (isInCreateMode()) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } else { + this.updateRegistryUpdateParameters.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + } + + public RegistryImpl withNetworkRuleBypassOptions(NetworkRuleBypassOptions networkRuleBypassOptions) { + if (isInCreateMode()) { + this.innerModel().withNetworkRuleBypassOptions(networkRuleBypassOptions); + return this; + } else { + this.updateRegistryUpdateParameters.withNetworkRuleBypassOptions(networkRuleBypassOptions); + return this; + } + } + + public RegistryImpl withZoneRedundancy(ZoneRedundancy zoneRedundancy) { + this.innerModel().withZoneRedundancy(zoneRedundancy); + return this; + } + + public RegistryImpl withAnonymousPullEnabled(Boolean anonymousPullEnabled) { + if (isInCreateMode()) { + this.innerModel().withAnonymousPullEnabled(anonymousPullEnabled); + return this; + } else { + this.updateRegistryUpdateParameters.withAnonymousPullEnabled(anonymousPullEnabled); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryListCredentialsResultImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryListCredentialsResultImpl.java new file mode 100644 index 000000000000..3900512f2c4a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryListCredentialsResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryListCredentialsResultInner; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryListCredentialsResult; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryPassword; +import java.util.Collections; +import java.util.List; + +public final class RegistryListCredentialsResultImpl implements RegistryListCredentialsResult { + private RegistryListCredentialsResultInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + RegistryListCredentialsResultImpl( + RegistryListCredentialsResultInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String username() { + return this.innerModel().username(); + } + + public List passwords() { + List inner = this.innerModel().passwords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RegistryListCredentialsResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryNameStatusImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryNameStatusImpl.java new file mode 100644 index 000000000000..d8feefad1a5f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryNameStatusImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryNameStatusInner; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryNameStatus; + +public final class RegistryNameStatusImpl implements RegistryNameStatus { + private RegistryNameStatusInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + RegistryNameStatusImpl( + RegistryNameStatusInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public RegistryNameStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryUsageListResultImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryUsageListResultImpl.java new file mode 100644 index 000000000000..dff452d0f9ae --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/RegistryUsageListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryUsageListResultInner; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryUsage; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryUsageListResult; +import java.util.Collections; +import java.util.List; + +public final class RegistryUsageListResultImpl implements RegistryUsageListResult { + private RegistryUsageListResultInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + RegistryUsageListResultImpl( + RegistryUsageListResultInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public RegistryUsageListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationImpl.java new file mode 100644 index 000000000000..2c44c335c159 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationImpl.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ReplicationInner; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.Replication; +import com.azure.resourcemanager.containerregistry.generated.models.ReplicationUpdateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.Status; +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import java.util.Collections; +import java.util.Map; + +public final class ReplicationImpl implements Replication, Replication.Definition, Replication.Update { + private ReplicationInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Status status() { + return this.innerModel().status(); + } + + public Boolean regionEndpointEnabled() { + return this.innerModel().regionEndpointEnabled(); + } + + public ZoneRedundancy zoneRedundancy() { + return this.innerModel().zoneRedundancy(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ReplicationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String replicationName; + + private ReplicationUpdateParameters updateReplicationUpdateParameters; + + public ReplicationImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public Replication create() { + this.innerObject = + serviceManager + .serviceClient() + .getReplications() + .create(resourceGroupName, registryName, replicationName, this.innerModel(), Context.NONE); + return this; + } + + public Replication create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplications() + .create(resourceGroupName, registryName, replicationName, this.innerModel(), context); + return this; + } + + ReplicationImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new ReplicationInner(); + this.serviceManager = serviceManager; + this.replicationName = name; + } + + public ReplicationImpl update() { + this.updateReplicationUpdateParameters = new ReplicationUpdateParameters(); + return this; + } + + public Replication apply() { + this.innerObject = + serviceManager + .serviceClient() + .getReplications() + .update( + resourceGroupName, registryName, replicationName, updateReplicationUpdateParameters, Context.NONE); + return this; + } + + public Replication apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplications() + .update(resourceGroupName, registryName, replicationName, updateReplicationUpdateParameters, context); + return this; + } + + ReplicationImpl( + ReplicationInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.replicationName = Utils.getValueFromIdByName(innerObject.id(), "replications"); + } + + public Replication refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getReplications() + .getWithResponse(resourceGroupName, registryName, replicationName, Context.NONE) + .getValue(); + return this; + } + + public Replication refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getReplications() + .getWithResponse(resourceGroupName, registryName, replicationName, context) + .getValue(); + return this; + } + + public ReplicationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ReplicationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ReplicationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateReplicationUpdateParameters.withTags(tags); + return this; + } + } + + public ReplicationImpl withRegionEndpointEnabled(Boolean regionEndpointEnabled) { + if (isInCreateMode()) { + this.innerModel().withRegionEndpointEnabled(regionEndpointEnabled); + return this; + } else { + this.updateReplicationUpdateParameters.withRegionEndpointEnabled(regionEndpointEnabled); + return this; + } + } + + public ReplicationImpl withZoneRedundancy(ZoneRedundancy zoneRedundancy) { + this.innerModel().withZoneRedundancy(zoneRedundancy); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsClientImpl.java new file mode 100644 index 000000000000..28818272a5ff --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsClientImpl.java @@ -0,0 +1,1478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.ReplicationsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ReplicationInner; +import com.azure.resourcemanager.containerregistry.generated.models.ReplicationListResult; +import com.azure.resourcemanager.containerregistry.generated.models.ReplicationUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ReplicationsClient. */ +public final class ReplicationsClientImpl implements ReplicationsClient { + /** The proxy service used to perform REST calls. */ + private final ReplicationsService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ReplicationsClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(ReplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientReplications to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface ReplicationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/replications") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/replications/{replicationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("replicationName") String replicationName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/replications/{replicationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("replicationName") String replicationName, + @BodyParam("application/json") ReplicationInner replication, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/replications/{replicationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("replicationName") String replicationName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/replications/{replicationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("replicationName") String replicationName, + @BodyParam("application/json") ReplicationUpdateParameters replicationUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String replicationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String replicationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + accept, + context); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String replicationName) { + return getWithResponseAsync(resourceGroupName, registryName, replicationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationInner get(String resourceGroupName, String registryName, String replicationName) { + return getAsync(resourceGroupName, registryName, replicationName).block(); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String replicationName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, replicationName, context).block(); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + if (replication == null) { + return Mono.error(new IllegalArgumentException("Parameter replication is required and cannot be null.")); + } else { + replication.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + replication, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationInner replication, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + if (replication == null) { + return Mono.error(new IllegalArgumentException("Parameter replication is required and cannot be null.")); + } else { + replication.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + replication, + accept, + context); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationInner> beginCreateAsync( + String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, replicationName, replication); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationInner.class, + ReplicationInner.class, + this.client.getContext()); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationInner replication, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, replicationName, replication, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ReplicationInner.class, ReplicationInner.class, context); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationInner> beginCreate( + String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return beginCreateAsync(resourceGroupName, registryName, replicationName, replication).getSyncPoller(); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationInner> beginCreate( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationInner replication, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, replicationName, replication, context).getSyncPoller(); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return beginCreateAsync(resourceGroupName, registryName, replicationName, replication) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationInner replication, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, replicationName, replication, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationInner create( + String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return createAsync(resourceGroupName, registryName, replicationName, replication).block(); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationInner create( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationInner replication, + Context context) { + return createAsync(resourceGroupName, registryName, replicationName, replication, context).block(); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String replicationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String replicationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + context); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String replicationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, replicationName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String replicationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, replicationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String replicationName) { + return beginDeleteAsync(resourceGroupName, registryName, replicationName).getSyncPoller(); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String replicationName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, replicationName, context).getSyncPoller(); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String replicationName) { + return beginDeleteAsync(resourceGroupName, registryName, replicationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String replicationName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, replicationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String replicationName) { + deleteAsync(resourceGroupName, registryName, replicationName).block(); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String replicationName, Context context) { + deleteAsync(resourceGroupName, registryName, replicationName, context).block(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replicationUpdateParameters The parameters for updating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + if (replicationUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicationUpdateParameters is required and cannot be null.")); + } else { + replicationUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + replicationUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replicationUpdateParameters The parameters for updating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (replicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); + } + if (replicationUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter replicationUpdateParameters is required and cannot be null.")); + } else { + replicationUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + replicationName, + replicationUpdateParameters, + accept, + context); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replicationUpdateParameters The parameters for updating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplicationInner.class, + ReplicationInner.class, + this.client.getContext()); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replicationUpdateParameters The parameters for updating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ReplicationInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, registryName, replicationName, replicationUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ReplicationInner.class, ReplicationInner.class, context); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replicationUpdateParameters The parameters for updating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationInner> beginUpdate( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters) + .getSyncPoller(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replicationUpdateParameters The parameters for updating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ReplicationInner> beginUpdate( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replicationUpdateParameters The parameters for updating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replicationUpdateParameters The parameters for updating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replicationUpdateParameters The parameters for updating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationInner update( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters) { + return updateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters).block(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replicationUpdateParameters The parameters for updating a replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a replication for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationInner update( + String resourceGroupName, + String registryName, + String replicationName, + ReplicationUpdateParameters replicationUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, replicationName, replicationUpdateParameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsImpl.java new file mode 100644 index 000000000000..321082a43fdf --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ReplicationsImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.ReplicationsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ReplicationInner; +import com.azure.resourcemanager.containerregistry.generated.models.Replication; +import com.azure.resourcemanager.containerregistry.generated.models.Replications; + +public final class ReplicationsImpl implements Replications { + private static final ClientLogger LOGGER = new ClientLogger(ReplicationsImpl.class); + + private final ReplicationsClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public ReplicationsImpl( + ReplicationsClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new ReplicationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new ReplicationImpl(inner1, this.manager())); + } + + public Replication get(String resourceGroupName, String registryName, String replicationName) { + ReplicationInner inner = this.serviceClient().get(resourceGroupName, registryName, replicationName); + if (inner != null) { + return new ReplicationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String replicationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, replicationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ReplicationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String replicationName) { + this.serviceClient().delete(resourceGroupName, registryName, replicationName); + } + + public void delete(String resourceGroupName, String registryName, String replicationName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, replicationName, context); + } + + public Replication getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String replicationName = Utils.getValueFromIdByName(id, "replications"); + if (replicationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replications'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, replicationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String replicationName = Utils.getValueFromIdByName(id, "replications"); + if (replicationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replications'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, replicationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String replicationName = Utils.getValueFromIdByName(id, "replications"); + if (replicationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replications'.", id))); + } + this.delete(resourceGroupName, registryName, replicationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String replicationName = Utils.getValueFromIdByName(id, "replications"); + if (replicationName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'replications'.", id))); + } + this.delete(resourceGroupName, registryName, replicationName, context); + } + + private ReplicationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public ReplicationImpl define(String name) { + return new ReplicationImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapImpl.java new file mode 100644 index 000000000000..1bf615f5e02c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapImpl.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ScopeMapInner; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMap; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMapUpdateParameters; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class ScopeMapImpl implements ScopeMap, ScopeMap.Definition, ScopeMap.Update { + private ScopeMapInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String description() { + return this.innerModel().description(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public OffsetDateTime creationDate() { + return this.innerModel().creationDate(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List actions() { + List inner = this.innerModel().actions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ScopeMapInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String scopeMapName; + + private ScopeMapUpdateParameters updateScopeMapUpdateParameters; + + public ScopeMapImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public ScopeMap create() { + this.innerObject = + serviceManager + .serviceClient() + .getScopeMaps() + .create(resourceGroupName, registryName, scopeMapName, this.innerModel(), Context.NONE); + return this; + } + + public ScopeMap create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getScopeMaps() + .create(resourceGroupName, registryName, scopeMapName, this.innerModel(), context); + return this; + } + + ScopeMapImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new ScopeMapInner(); + this.serviceManager = serviceManager; + this.scopeMapName = name; + } + + public ScopeMapImpl update() { + this.updateScopeMapUpdateParameters = new ScopeMapUpdateParameters(); + return this; + } + + public ScopeMap apply() { + this.innerObject = + serviceManager + .serviceClient() + .getScopeMaps() + .update(resourceGroupName, registryName, scopeMapName, updateScopeMapUpdateParameters, Context.NONE); + return this; + } + + public ScopeMap apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getScopeMaps() + .update(resourceGroupName, registryName, scopeMapName, updateScopeMapUpdateParameters, context); + return this; + } + + ScopeMapImpl( + ScopeMapInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.scopeMapName = Utils.getValueFromIdByName(innerObject.id(), "scopeMaps"); + } + + public ScopeMap refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getScopeMaps() + .getWithResponse(resourceGroupName, registryName, scopeMapName, Context.NONE) + .getValue(); + return this; + } + + public ScopeMap refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getScopeMaps() + .getWithResponse(resourceGroupName, registryName, scopeMapName, context) + .getValue(); + return this; + } + + public ScopeMapImpl withDescription(String description) { + if (isInCreateMode()) { + this.innerModel().withDescription(description); + return this; + } else { + this.updateScopeMapUpdateParameters.withDescription(description); + return this; + } + } + + public ScopeMapImpl withActions(List actions) { + if (isInCreateMode()) { + this.innerModel().withActions(actions); + return this; + } else { + this.updateScopeMapUpdateParameters.withActions(actions); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsClientImpl.java new file mode 100644 index 000000000000..54cb5241c3f3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsClientImpl.java @@ -0,0 +1,1472 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.ScopeMapsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ScopeMapInner; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMapListResult; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMapUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ScopeMapsClient. */ +public final class ScopeMapsClientImpl implements ScopeMapsClient { + /** The proxy service used to perform REST calls. */ + private final ScopeMapsService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ScopeMapsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScopeMapsClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = + RestProxy.create(ScopeMapsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientScopeMaps to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface ScopeMapsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/scopeMaps") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/scopeMaps/{scopeMapName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("scopeMapName") String scopeMapName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/scopeMaps/{scopeMapName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("scopeMapName") String scopeMapName, + @BodyParam("application/json") ScopeMapInner scopeMapCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/scopeMaps/{scopeMapName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("scopeMapName") String scopeMapName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/scopeMaps/{scopeMapName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("scopeMapName") String scopeMapName, + @BodyParam("application/json") ScopeMapUpdateParameters scopeMapUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String scopeMapName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + accept, + context); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String scopeMapName) { + return getWithResponseAsync(resourceGroupName, registryName, scopeMapName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopeMapInner get(String resourceGroupName, String registryName, String scopeMapName) { + return getAsync(resourceGroupName, registryName, scopeMapName).block(); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, scopeMapName, context).block(); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + if (scopeMapCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter scopeMapCreateParameters is required and cannot be null.")); + } else { + scopeMapCreateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + scopeMapCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapInner scopeMapCreateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + if (scopeMapCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter scopeMapCreateParameters is required and cannot be null.")); + } else { + scopeMapCreateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + scopeMapCreateParameters, + accept, + context); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ScopeMapInner> beginCreateAsync( + String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ScopeMapInner.class, + ScopeMapInner.class, + this.client.getContext()); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ScopeMapInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapInner scopeMapCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ScopeMapInner.class, ScopeMapInner.class, context); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ScopeMapInner> beginCreate( + String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters) + .getSyncPoller(); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ScopeMapInner> beginCreate( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapInner scopeMapCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapInner scopeMapCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopeMapInner create( + String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + return createAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters).block(); + } + + /** + * Creates a scope map for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopeMapInner create( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapInner scopeMapCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters, context).block(); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String scopeMapName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + accept, + context); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String scopeMapName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, scopeMapName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, scopeMapName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String scopeMapName) { + return beginDeleteAsync(resourceGroupName, registryName, scopeMapName).getSyncPoller(); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, scopeMapName, context).getSyncPoller(); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String scopeMapName) { + return beginDeleteAsync(resourceGroupName, registryName, scopeMapName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, scopeMapName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String scopeMapName) { + deleteAsync(resourceGroupName, registryName, scopeMapName).block(); + } + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String scopeMapName, Context context) { + deleteAsync(resourceGroupName, registryName, scopeMapName, context).block(); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + if (scopeMapUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter scopeMapUpdateParameters is required and cannot be null.")); + } else { + scopeMapUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + scopeMapUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (scopeMapName == null) { + return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); + } + if (scopeMapUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter scopeMapUpdateParameters is required and cannot be null.")); + } else { + scopeMapUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + scopeMapName, + scopeMapUpdateParameters, + accept, + context); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ScopeMapInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ScopeMapInner.class, + ScopeMapInner.class, + this.client.getContext()); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ScopeMapInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ScopeMapInner.class, ScopeMapInner.class, context); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ScopeMapInner> beginUpdate( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters) + .getSyncPoller(); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ScopeMapInner> beginUpdate( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopeMapInner update( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters) { + return updateAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters).block(); + } + + /** + * Updates a scope map with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a scope map for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ScopeMapInner update( + String resourceGroupName, + String registryName, + String scopeMapName, + ScopeMapUpdateParameters scopeMapUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsImpl.java new file mode 100644 index 000000000000..8de167f245af --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/ScopeMapsImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.ScopeMapsClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ScopeMapInner; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMap; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMaps; + +public final class ScopeMapsImpl implements ScopeMaps { + private static final ClientLogger LOGGER = new ClientLogger(ScopeMapsImpl.class); + + private final ScopeMapsClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public ScopeMapsImpl( + ScopeMapsClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new ScopeMapImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new ScopeMapImpl(inner1, this.manager())); + } + + public ScopeMap get(String resourceGroupName, String registryName, String scopeMapName) { + ScopeMapInner inner = this.serviceClient().get(resourceGroupName, registryName, scopeMapName); + if (inner != null) { + return new ScopeMapImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String scopeMapName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, scopeMapName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ScopeMapImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String scopeMapName) { + this.serviceClient().delete(resourceGroupName, registryName, scopeMapName); + } + + public void delete(String resourceGroupName, String registryName, String scopeMapName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, scopeMapName, context); + } + + public ScopeMap getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String scopeMapName = Utils.getValueFromIdByName(id, "scopeMaps"); + if (scopeMapName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scopeMaps'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, scopeMapName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String scopeMapName = Utils.getValueFromIdByName(id, "scopeMaps"); + if (scopeMapName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scopeMaps'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, scopeMapName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String scopeMapName = Utils.getValueFromIdByName(id, "scopeMaps"); + if (scopeMapName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scopeMaps'.", id))); + } + this.delete(resourceGroupName, registryName, scopeMapName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String scopeMapName = Utils.getValueFromIdByName(id, "scopeMaps"); + if (scopeMapName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scopeMaps'.", id))); + } + this.delete(resourceGroupName, registryName, scopeMapName, context); + } + + private ScopeMapsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public ScopeMapImpl define(String name) { + return new ScopeMapImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokenImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokenImpl.java new file mode 100644 index 000000000000..8b6054350c29 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokenImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TokenInner; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.Token; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCredentialsProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TokenStatus; +import com.azure.resourcemanager.containerregistry.generated.models.TokenUpdateParameters; +import java.time.OffsetDateTime; + +public final class TokenImpl implements Token, Token.Definition, Token.Update { + private TokenInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OffsetDateTime creationDate() { + return this.innerModel().creationDate(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String scopeMapId() { + return this.innerModel().scopeMapId(); + } + + public TokenCredentialsProperties credentials() { + return this.innerModel().credentials(); + } + + public TokenStatus status() { + return this.innerModel().status(); + } + + public TokenInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String tokenName; + + private TokenUpdateParameters updateTokenUpdateParameters; + + public TokenImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public Token create() { + this.innerObject = + serviceManager + .serviceClient() + .getTokens() + .create(resourceGroupName, registryName, tokenName, this.innerModel(), Context.NONE); + return this; + } + + public Token create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTokens() + .create(resourceGroupName, registryName, tokenName, this.innerModel(), context); + return this; + } + + TokenImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new TokenInner(); + this.serviceManager = serviceManager; + this.tokenName = name; + } + + public TokenImpl update() { + this.updateTokenUpdateParameters = new TokenUpdateParameters(); + return this; + } + + public Token apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTokens() + .update(resourceGroupName, registryName, tokenName, updateTokenUpdateParameters, Context.NONE); + return this; + } + + public Token apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTokens() + .update(resourceGroupName, registryName, tokenName, updateTokenUpdateParameters, context); + return this; + } + + TokenImpl( + TokenInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.tokenName = Utils.getValueFromIdByName(innerObject.id(), "tokens"); + } + + public Token refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTokens() + .getWithResponse(resourceGroupName, registryName, tokenName, Context.NONE) + .getValue(); + return this; + } + + public Token refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTokens() + .getWithResponse(resourceGroupName, registryName, tokenName, context) + .getValue(); + return this; + } + + public TokenImpl withScopeMapId(String scopeMapId) { + if (isInCreateMode()) { + this.innerModel().withScopeMapId(scopeMapId); + return this; + } else { + this.updateTokenUpdateParameters.withScopeMapId(scopeMapId); + return this; + } + } + + public TokenImpl withCredentials(TokenCredentialsProperties credentials) { + if (isInCreateMode()) { + this.innerModel().withCredentials(credentials); + return this; + } else { + this.updateTokenUpdateParameters.withCredentials(credentials); + return this; + } + } + + public TokenImpl withStatus(TokenStatus status) { + if (isInCreateMode()) { + this.innerModel().withStatus(status); + return this; + } else { + this.updateTokenUpdateParameters.withStatus(status); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensClientImpl.java new file mode 100644 index 000000000000..d2e4b5be5acb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensClientImpl.java @@ -0,0 +1,1441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.TokensClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TokenInner; +import com.azure.resourcemanager.containerregistry.generated.models.TokenListResult; +import com.azure.resourcemanager.containerregistry.generated.models.TokenUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in TokensClient. */ +public final class TokensClientImpl implements TokensClient { + /** The proxy service used to perform REST calls. */ + private final TokensService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of TokensClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TokensClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = RestProxy.create(TokensService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientTokens to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface TokensService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tokens") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tokens/{tokenName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("tokenName") String tokenName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tokens/{tokenName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("tokenName") String tokenName, + @BodyParam("application/json") TokenInner tokenCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tokens/{tokenName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("tokenName") String tokenName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/tokens/{tokenName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("tokenName") String tokenName, + @BodyParam("application/json") TokenUpdateParameters tokenUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String tokenName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String tokenName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + accept, + context); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String tokenName) { + return getWithResponseAsync(resourceGroupName, registryName, tokenName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TokenInner get(String resourceGroupName, String registryName, String tokenName) { + return getAsync(resourceGroupName, registryName, tokenName).block(); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String tokenName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, tokenName, context).block(); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + if (tokenCreateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter tokenCreateParameters is required and cannot be null.")); + } else { + tokenCreateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + tokenCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String tokenName, + TokenInner tokenCreateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + if (tokenCreateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter tokenCreateParameters is required and cannot be null.")); + } else { + tokenCreateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + tokenCreateParameters, + accept, + context); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TokenInner> beginCreateAsync( + String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TokenInner.class, TokenInner.class, this.client.getContext()); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TokenInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String tokenName, + TokenInner tokenCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TokenInner.class, TokenInner.class, context); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TokenInner> beginCreate( + String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters).getSyncPoller(); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TokenInner> beginCreate( + String resourceGroupName, + String registryName, + String tokenName, + TokenInner tokenCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String tokenName, + TokenInner tokenCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TokenInner create( + String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + return createAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters).block(); + } + + /** + * Creates a token for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TokenInner create( + String resourceGroupName, + String registryName, + String tokenName, + TokenInner tokenCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, context).block(); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String tokenName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String tokenName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + accept, + context); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String tokenName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, tokenName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String tokenName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, tokenName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String tokenName) { + return beginDeleteAsync(resourceGroupName, registryName, tokenName).getSyncPoller(); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String tokenName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, tokenName, context).getSyncPoller(); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String tokenName) { + return beginDeleteAsync(resourceGroupName, registryName, tokenName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String tokenName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, tokenName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String tokenName) { + deleteAsync(resourceGroupName, registryName, tokenName).block(); + } + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String tokenName, Context context) { + deleteAsync(resourceGroupName, registryName, tokenName, context).block(); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + if (tokenUpdateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter tokenUpdateParameters is required and cannot be null.")); + } else { + tokenUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + tokenUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String tokenName, + TokenUpdateParameters tokenUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (tokenName == null) { + return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); + } + if (tokenUpdateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter tokenUpdateParameters is required and cannot be null.")); + } else { + tokenUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + tokenName, + tokenUpdateParameters, + accept, + context); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TokenInner> beginUpdateAsync( + String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TokenInner.class, TokenInner.class, this.client.getContext()); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TokenInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String tokenName, + TokenUpdateParameters tokenUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TokenInner.class, TokenInner.class, context); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TokenInner> beginUpdate( + String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters).getSyncPoller(); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TokenInner> beginUpdate( + String resourceGroupName, + String registryName, + String tokenName, + TokenUpdateParameters tokenUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String tokenName, + TokenUpdateParameters tokenUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TokenInner update( + String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + return updateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters).block(); + } + + /** + * Updates a token with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a token for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TokenInner update( + String resourceGroupName, + String registryName, + String tokenName, + TokenUpdateParameters tokenUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensImpl.java new file mode 100644 index 000000000000..ebe9c60bcf5a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/TokensImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.TokensClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TokenInner; +import com.azure.resourcemanager.containerregistry.generated.models.Token; +import com.azure.resourcemanager.containerregistry.generated.models.Tokens; + +public final class TokensImpl implements Tokens { + private static final ClientLogger LOGGER = new ClientLogger(TokensImpl.class); + + private final TokensClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public TokensImpl( + TokensClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new TokenImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new TokenImpl(inner1, this.manager())); + } + + public Token get(String resourceGroupName, String registryName, String tokenName) { + TokenInner inner = this.serviceClient().get(resourceGroupName, registryName, tokenName); + if (inner != null) { + return new TokenImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String tokenName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, tokenName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TokenImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String tokenName) { + this.serviceClient().delete(resourceGroupName, registryName, tokenName); + } + + public void delete(String resourceGroupName, String registryName, String tokenName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, tokenName, context); + } + + public Token getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String tokenName = Utils.getValueFromIdByName(id, "tokens"); + if (tokenName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tokens'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, tokenName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String tokenName = Utils.getValueFromIdByName(id, "tokens"); + if (tokenName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tokens'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, tokenName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String tokenName = Utils.getValueFromIdByName(id, "tokens"); + if (tokenName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tokens'.", id))); + } + this.delete(resourceGroupName, registryName, tokenName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String tokenName = Utils.getValueFromIdByName(id, "tokens"); + if (tokenName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tokens'.", id))); + } + this.delete(resourceGroupName, registryName, tokenName, context); + } + + private TokensClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public TokenImpl define(String name) { + return new TokenImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/Utils.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/Utils.java new file mode 100644 index 000000000000..c6ca9fbaaaf1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhookImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhookImpl.java new file mode 100644 index 000000000000..e364c0fe34c9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhookImpl.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookInner; +import com.azure.resourcemanager.containerregistry.generated.models.CallbackConfig; +import com.azure.resourcemanager.containerregistry.generated.models.Event; +import com.azure.resourcemanager.containerregistry.generated.models.EventInfo; +import com.azure.resourcemanager.containerregistry.generated.models.ProvisioningState; +import com.azure.resourcemanager.containerregistry.generated.models.Webhook; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookCreateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookUpdateParameters; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class WebhookImpl implements Webhook, Webhook.Definition, Webhook.Update { + private WebhookInner innerObject; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public WebhookStatus status() { + return this.innerModel().status(); + } + + public String scope() { + return this.innerModel().scope(); + } + + public List actions() { + List inner = this.innerModel().actions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public WebhookInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String registryName; + + private String webhookName; + + private WebhookCreateParameters createWebhookCreateParameters; + + private WebhookUpdateParameters updateWebhookUpdateParameters; + + public WebhookImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + public Webhook create() { + this.innerObject = + serviceManager + .serviceClient() + .getWebhooks() + .create(resourceGroupName, registryName, webhookName, createWebhookCreateParameters, Context.NONE); + return this; + } + + public Webhook create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWebhooks() + .create(resourceGroupName, registryName, webhookName, createWebhookCreateParameters, context); + return this; + } + + WebhookImpl( + String name, com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = new WebhookInner(); + this.serviceManager = serviceManager; + this.webhookName = name; + this.createWebhookCreateParameters = new WebhookCreateParameters(); + } + + public WebhookImpl update() { + this.updateWebhookUpdateParameters = new WebhookUpdateParameters(); + return this; + } + + public Webhook apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWebhooks() + .update(resourceGroupName, registryName, webhookName, updateWebhookUpdateParameters, Context.NONE); + return this; + } + + public Webhook apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWebhooks() + .update(resourceGroupName, registryName, webhookName, updateWebhookUpdateParameters, context); + return this; + } + + WebhookImpl( + WebhookInner innerObject, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.registryName = Utils.getValueFromIdByName(innerObject.id(), "registries"); + this.webhookName = Utils.getValueFromIdByName(innerObject.id(), "webhooks"); + } + + public Webhook refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWebhooks() + .getWithResponse(resourceGroupName, registryName, webhookName, Context.NONE) + .getValue(); + return this; + } + + public Webhook refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWebhooks() + .getWithResponse(resourceGroupName, registryName, webhookName, context) + .getValue(); + return this; + } + + public EventInfo ping() { + return serviceManager.webhooks().ping(resourceGroupName, registryName, webhookName); + } + + public Response pingWithResponse(Context context) { + return serviceManager.webhooks().pingWithResponse(resourceGroupName, registryName, webhookName, context); + } + + public PagedIterable listEvents() { + return serviceManager.webhooks().listEvents(resourceGroupName, registryName, webhookName); + } + + public PagedIterable listEvents(Context context) { + return serviceManager.webhooks().listEvents(resourceGroupName, registryName, webhookName, context); + } + + public CallbackConfig getCallbackConfig() { + return serviceManager.webhooks().getCallbackConfig(resourceGroupName, registryName, webhookName); + } + + public Response getCallbackConfigWithResponse(Context context) { + return serviceManager + .webhooks() + .getCallbackConfigWithResponse(resourceGroupName, registryName, webhookName, context); + } + + public WebhookImpl withRegion(Region location) { + this.createWebhookCreateParameters.withLocation(location.toString()); + return this; + } + + public WebhookImpl withRegion(String location) { + this.createWebhookCreateParameters.withLocation(location); + return this; + } + + public WebhookImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createWebhookCreateParameters.withTags(tags); + return this; + } else { + this.updateWebhookUpdateParameters.withTags(tags); + return this; + } + } + + public WebhookImpl withServiceUri(String serviceUri) { + if (isInCreateMode()) { + this.createWebhookCreateParameters.withServiceUri(serviceUri); + return this; + } else { + this.updateWebhookUpdateParameters.withServiceUri(serviceUri); + return this; + } + } + + public WebhookImpl withCustomHeaders(Map customHeaders) { + if (isInCreateMode()) { + this.createWebhookCreateParameters.withCustomHeaders(customHeaders); + return this; + } else { + this.updateWebhookUpdateParameters.withCustomHeaders(customHeaders); + return this; + } + } + + public WebhookImpl withStatus(WebhookStatus status) { + if (isInCreateMode()) { + this.createWebhookCreateParameters.withStatus(status); + return this; + } else { + this.updateWebhookUpdateParameters.withStatus(status); + return this; + } + } + + public WebhookImpl withScope(String scope) { + if (isInCreateMode()) { + this.createWebhookCreateParameters.withScope(scope); + return this; + } else { + this.updateWebhookUpdateParameters.withScope(scope); + return this; + } + } + + public WebhookImpl withActions(List actions) { + if (isInCreateMode()) { + this.createWebhookCreateParameters.withActions(actions); + return this; + } else { + this.updateWebhookUpdateParameters.withActions(actions); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhooksClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhooksClientImpl.java new file mode 100644 index 000000000000..1eaa7ca39e57 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhooksClientImpl.java @@ -0,0 +1,2131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.generated.fluent.WebhooksClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.CallbackConfigInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInfoInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookInner; +import com.azure.resourcemanager.containerregistry.generated.models.EventListResult; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookCreateParameters; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookListResult; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WebhooksClient. */ +public final class WebhooksClientImpl implements WebhooksClient { + /** The proxy service used to perform REST calls. */ + private final WebhooksService service; + + /** The service client containing this operation class. */ + private final ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of WebhooksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WebhooksClientImpl(ContainerRegistryManagementClientImpl client) { + this.service = RestProxy.create(WebhooksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryManagementClientWebhooks to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryMan") + private interface WebhooksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks/{webhookName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("webhookName") String webhookName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks/{webhookName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("webhookName") String webhookName, + @BodyParam("application/json") WebhookCreateParameters webhookCreateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks/{webhookName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("webhookName") String webhookName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks/{webhookName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("webhookName") String webhookName, + @BodyParam("application/json") WebhookUpdateParameters webhookUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks/{webhookName}/ping") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> ping( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("webhookName") String webhookName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks/{webhookName}/listEvents") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listEvents( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("webhookName") String webhookName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry" + + "/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCallbackConfig( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("registryName") String registryName, + @PathParam("webhookName") String webhookName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listEventsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String webhookName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String registryName, String webhookName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String registryName, String webhookName) { + return getWithResponseAsync(resourceGroupName, registryName, webhookName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebhookInner get(String resourceGroupName, String registryName, String webhookName) { + return getAsync(resourceGroupName, registryName, webhookName).block(); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context) { + return getWithResponseAsync(resourceGroupName, registryName, webhookName, context).block(); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + if (webhookCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null.")); + } else { + webhookCreateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + webhookCreateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + if (webhookCreateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null.")); + } else { + webhookCreateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + webhookCreateParameters, + accept, + context); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WebhookInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WebhookInner.class, WebhookInner.class, this.client.getContext()); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WebhookInner> beginCreateAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WebhookInner.class, WebhookInner.class, context); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WebhookInner> beginCreate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).getSyncPoller(); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WebhookInner> beginCreate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters, context) + .getSyncPoller(); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters) { + return beginCreateAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters, + Context context) { + return beginCreateAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebhookInner create( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters) { + return createAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).block(); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebhookInner create( + String resourceGroupName, + String registryName, + String webhookName, + WebhookCreateParameters webhookCreateParameters, + Context context) { + return createAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters, context).block(); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String webhookName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String registryName, String webhookName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + context); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String webhookName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, webhookName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String registryName, String webhookName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, registryName, webhookName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String webhookName) { + return beginDeleteAsync(resourceGroupName, registryName, webhookName).getSyncPoller(); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String registryName, String webhookName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, webhookName, context).getSyncPoller(); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String webhookName) { + return beginDeleteAsync(resourceGroupName, registryName, webhookName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String registryName, String webhookName, Context context) { + return beginDeleteAsync(resourceGroupName, registryName, webhookName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String webhookName) { + deleteAsync(resourceGroupName, registryName, webhookName).block(); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String webhookName, Context context) { + deleteAsync(resourceGroupName, registryName, webhookName, context).block(); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + if (webhookUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null.")); + } else { + webhookUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + webhookUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + if (webhookUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null.")); + } else { + webhookUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + webhookUpdateParameters, + accept, + context); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WebhookInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WebhookInner.class, WebhookInner.class, this.client.getContext()); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WebhookInner> beginUpdateAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WebhookInner.class, WebhookInner.class, context); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WebhookInner> beginUpdate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).getSyncPoller(); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WebhookInner> beginUpdate( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters) { + return beginUpdateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebhookInner update( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters) { + return updateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).block(); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an object that represents a webhook for a container registry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WebhookInner update( + String resourceGroupName, + String registryName, + String webhookName, + WebhookUpdateParameters webhookUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters, context).block(); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> pingWithResponseAsync( + String resourceGroupName, String registryName, String webhookName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .ping( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> pingWithResponseAsync( + String resourceGroupName, String registryName, String webhookName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .ping( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono pingAsync(String resourceGroupName, String registryName, String webhookName) { + return pingWithResponseAsync(resourceGroupName, registryName, webhookName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventInfoInner ping(String resourceGroupName, String registryName, String webhookName) { + return pingAsync(resourceGroupName, registryName, webhookName).block(); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response pingWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context) { + return pingWithResponseAsync(resourceGroupName, registryName, webhookName, context).block(); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listEventsSinglePageAsync( + String resourceGroupName, String registryName, String webhookName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listEvents( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listEventsSinglePageAsync( + String resourceGroupName, String registryName, String webhookName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listEvents( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listEventsAsync(String resourceGroupName, String registryName, String webhookName) { + return new PagedFlux<>( + () -> listEventsSinglePageAsync(resourceGroupName, registryName, webhookName), + nextLink -> listEventsNextSinglePageAsync(nextLink)); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listEventsAsync( + String resourceGroupName, String registryName, String webhookName, Context context) { + return new PagedFlux<>( + () -> listEventsSinglePageAsync(resourceGroupName, registryName, webhookName, context), + nextLink -> listEventsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listEvents(String resourceGroupName, String registryName, String webhookName) { + return new PagedIterable<>(listEventsAsync(resourceGroupName, registryName, webhookName)); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listEvents( + String resourceGroupName, String registryName, String webhookName, Context context) { + return new PagedIterable<>(listEventsAsync(resourceGroupName, registryName, webhookName, context)); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCallbackConfigWithResponseAsync( + String resourceGroupName, String registryName, String webhookName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getCallbackConfig( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCallbackConfigWithResponseAsync( + String resourceGroupName, String registryName, String webhookName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (webhookName == null) { + return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getCallbackConfig( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + registryName, + webhookName, + accept, + context); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getCallbackConfigAsync( + String resourceGroupName, String registryName, String webhookName) { + return getCallbackConfigWithResponseAsync(resourceGroupName, registryName, webhookName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CallbackConfigInner getCallbackConfig(String resourceGroupName, String registryName, String webhookName) { + return getCallbackConfigAsync(resourceGroupName, registryName, webhookName).block(); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCallbackConfigWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context) { + return getCallbackConfigWithResponseAsync(resourceGroupName, registryName, webhookName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listEventsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listEventsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listEventsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listEventsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhooksImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhooksImpl.java new file mode 100644 index 000000000000..518eb7ece9e4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/WebhooksImpl.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.WebhooksClient; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.CallbackConfigInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInfoInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInner; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookInner; +import com.azure.resourcemanager.containerregistry.generated.models.CallbackConfig; +import com.azure.resourcemanager.containerregistry.generated.models.Event; +import com.azure.resourcemanager.containerregistry.generated.models.EventInfo; +import com.azure.resourcemanager.containerregistry.generated.models.Webhook; +import com.azure.resourcemanager.containerregistry.generated.models.Webhooks; + +public final class WebhooksImpl implements Webhooks { + private static final ClientLogger LOGGER = new ClientLogger(WebhooksImpl.class); + + private final WebhooksClient innerClient; + + private final com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager; + + public WebhooksImpl( + WebhooksClient innerClient, + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String registryName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName); + return Utils.mapPage(inner, inner1 -> new WebhookImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, registryName, context); + return Utils.mapPage(inner, inner1 -> new WebhookImpl(inner1, this.manager())); + } + + public Webhook get(String resourceGroupName, String registryName, String webhookName) { + WebhookInner inner = this.serviceClient().get(resourceGroupName, registryName, webhookName); + if (inner != null) { + return new WebhookImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, registryName, webhookName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WebhookImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String registryName, String webhookName) { + this.serviceClient().delete(resourceGroupName, registryName, webhookName); + } + + public void delete(String resourceGroupName, String registryName, String webhookName, Context context) { + this.serviceClient().delete(resourceGroupName, registryName, webhookName, context); + } + + public EventInfo ping(String resourceGroupName, String registryName, String webhookName) { + EventInfoInner inner = this.serviceClient().ping(resourceGroupName, registryName, webhookName); + if (inner != null) { + return new EventInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response pingWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context) { + Response inner = + this.serviceClient().pingWithResponse(resourceGroupName, registryName, webhookName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EventInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listEvents(String resourceGroupName, String registryName, String webhookName) { + PagedIterable inner = this.serviceClient().listEvents(resourceGroupName, registryName, webhookName); + return Utils.mapPage(inner, inner1 -> new EventImpl(inner1, this.manager())); + } + + public PagedIterable listEvents( + String resourceGroupName, String registryName, String webhookName, Context context) { + PagedIterable inner = + this.serviceClient().listEvents(resourceGroupName, registryName, webhookName, context); + return Utils.mapPage(inner, inner1 -> new EventImpl(inner1, this.manager())); + } + + public CallbackConfig getCallbackConfig(String resourceGroupName, String registryName, String webhookName) { + CallbackConfigInner inner = + this.serviceClient().getCallbackConfig(resourceGroupName, registryName, webhookName); + if (inner != null) { + return new CallbackConfigImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getCallbackConfigWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context) { + Response inner = + this.serviceClient().getCallbackConfigWithResponse(resourceGroupName, registryName, webhookName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CallbackConfigImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Webhook getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String webhookName = Utils.getValueFromIdByName(id, "webhooks"); + if (webhookName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webhooks'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, webhookName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String webhookName = Utils.getValueFromIdByName(id, "webhooks"); + if (webhookName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webhooks'.", id))); + } + return this.getWithResponse(resourceGroupName, registryName, webhookName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String webhookName = Utils.getValueFromIdByName(id, "webhooks"); + if (webhookName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webhooks'.", id))); + } + this.delete(resourceGroupName, registryName, webhookName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String registryName = Utils.getValueFromIdByName(id, "registries"); + if (registryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'registries'.", id))); + } + String webhookName = Utils.getValueFromIdByName(id, "webhooks"); + if (webhookName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'webhooks'.", id))); + } + this.delete(resourceGroupName, registryName, webhookName, context); + } + + private WebhooksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager() { + return this.serviceManager; + } + + public WebhookImpl define(String name) { + return new WebhookImpl(name, this.manager()); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/package-info.java new file mode 100644 index 000000000000..07abd9fff534 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for ContainerRegistryManagementClient. null. */ +package com.azure.resourcemanager.containerregistry.generated.implementation; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Action.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Action.java new file mode 100644 index 000000000000..13e8cdabd065 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Action.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Action. */ +public final class Action extends ExpandableStringEnum { + /** Static value Allow for Action. */ + public static final Action ALLOW = fromString("Allow"); + + /** + * Creates or finds a Action from its string representation. + * + * @param name a name to look for. + * @return the corresponding Action. + */ + @JsonCreator + public static Action fromString(String name) { + return fromString(name, Action.class); + } + + /** @return known Action values. */ + public static Collection values() { + return values(Action.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActionsRequired.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActionsRequired.java new file mode 100644 index 000000000000..2130a9eccbd5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActionsRequired.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActionsRequired. */ +public final class ActionsRequired extends ExpandableStringEnum { + /** Static value None for ActionsRequired. */ + public static final ActionsRequired NONE = fromString("None"); + + /** Static value Recreate for ActionsRequired. */ + public static final ActionsRequired RECREATE = fromString("Recreate"); + + /** + * Creates or finds a ActionsRequired from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionsRequired. + */ + @JsonCreator + public static ActionsRequired fromString(String name) { + return fromString(name, ActionsRequired.class); + } + + /** @return known ActionsRequired values. */ + public static Collection values() { + return values(ActionsRequired.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActivationProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActivationProperties.java new file mode 100644 index 000000000000..cf0e67492371 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActivationProperties.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The activation properties of the connected registry. */ +@Immutable +public final class ActivationProperties { + /* + * The activation status of the connected registry. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ActivationStatus status; + + /** + * Get the status property: The activation status of the connected registry. + * + * @return the status value. + */ + public ActivationStatus status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActivationStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActivationStatus.java new file mode 100644 index 000000000000..0b2b15f91913 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ActivationStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActivationStatus. */ +public final class ActivationStatus extends ExpandableStringEnum { + /** Static value Active for ActivationStatus. */ + public static final ActivationStatus ACTIVE = fromString("Active"); + + /** Static value Inactive for ActivationStatus. */ + public static final ActivationStatus INACTIVE = fromString("Inactive"); + + /** + * Creates or finds a ActivationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActivationStatus. + */ + @JsonCreator + public static ActivationStatus fromString(String name) { + return fromString(name, ActivationStatus.class); + } + + /** @return known ActivationStatus values. */ + public static Collection values() { + return values(ActivationStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Actor.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Actor.java new file mode 100644 index 000000000000..3355899adb14 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Actor.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The agent that initiated the event. For most situations, this could be from the authorization context of the request. + */ +@Fluent +public final class Actor { + /* + * The subject or username associated with the request context that + * generated the event. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name property: The subject or username associated with the request context that generated the event. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The subject or username associated with the request context that generated the event. + * + * @param name the name value to set. + * @return the Actor object itself. + */ + public Actor withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuditLogStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuditLogStatus.java new file mode 100644 index 000000000000..a16c1788e727 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AuditLogStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AuditLogStatus. */ +public final class AuditLogStatus extends ExpandableStringEnum { + /** Static value Enabled for AuditLogStatus. */ + public static final AuditLogStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for AuditLogStatus. */ + public static final AuditLogStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a AuditLogStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuditLogStatus. + */ + @JsonCreator + public static AuditLogStatus fromString(String name) { + return fromString(name, AuditLogStatus.class); + } + + /** @return known AuditLogStatus values. */ + public static Collection values() { + return values(AuditLogStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AzureADAuthenticationAsArmPolicy.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AzureADAuthenticationAsArmPolicy.java new file mode 100644 index 000000000000..0aa1cdce5c8f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AzureADAuthenticationAsArmPolicy.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The policy for using ARM audience token for a container registry. */ +@Fluent +public final class AzureADAuthenticationAsArmPolicy { + /* + * The value that indicates whether the policy is enabled or not. + */ + @JsonProperty(value = "status") + private AzureADAuthenticationAsArmPolicyStatus status; + + /** + * Get the status property: The value that indicates whether the policy is enabled or not. + * + * @return the status value. + */ + public AzureADAuthenticationAsArmPolicyStatus status() { + return this.status; + } + + /** + * Set the status property: The value that indicates whether the policy is enabled or not. + * + * @param status the status value to set. + * @return the AzureADAuthenticationAsArmPolicy object itself. + */ + public AzureADAuthenticationAsArmPolicy withStatus(AzureADAuthenticationAsArmPolicyStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AzureADAuthenticationAsArmPolicyStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AzureADAuthenticationAsArmPolicyStatus.java new file mode 100644 index 000000000000..e1652ac5daaa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/AzureADAuthenticationAsArmPolicyStatus.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AzureADAuthenticationAsArmPolicyStatus. */ +public final class AzureADAuthenticationAsArmPolicyStatus + extends ExpandableStringEnum { + /** Static value enabled for AzureADAuthenticationAsArmPolicyStatus. */ + public static final AzureADAuthenticationAsArmPolicyStatus ENABLED = fromString("enabled"); + + /** Static value disabled for AzureADAuthenticationAsArmPolicyStatus. */ + public static final AzureADAuthenticationAsArmPolicyStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a AzureADAuthenticationAsArmPolicyStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureADAuthenticationAsArmPolicyStatus. + */ + @JsonCreator + public static AzureADAuthenticationAsArmPolicyStatus fromString(String name) { + return fromString(name, AzureADAuthenticationAsArmPolicyStatus.class); + } + + /** @return known AzureADAuthenticationAsArmPolicyStatus values. */ + public static Collection values() { + return values(AzureADAuthenticationAsArmPolicyStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CallbackConfig.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CallbackConfig.java new file mode 100644 index 000000000000..adfb179e3289 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CallbackConfig.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.CallbackConfigInner; +import java.util.Map; + +/** An immutable client-side representation of CallbackConfig. */ +public interface CallbackConfig { + /** + * Gets the serviceUri property: The service URI for the webhook to post notifications. + * + * @return the serviceUri value. + */ + String serviceUri(); + + /** + * Gets the customHeaders property: Custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value. + */ + Map customHeaders(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.CallbackConfigInner object. + * + * @return the inner object. + */ + CallbackConfigInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CertificateType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CertificateType.java new file mode 100644 index 000000000000..a3c320686250 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/CertificateType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CertificateType. */ +public final class CertificateType extends ExpandableStringEnum { + /** Static value LocalDirectory for CertificateType. */ + public static final CertificateType LOCAL_DIRECTORY = fromString("LocalDirectory"); + + /** + * Creates or finds a CertificateType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CertificateType. + */ + @JsonCreator + public static CertificateType fromString(String name) { + return fromString(name, CertificateType.class); + } + + /** @return known CertificateType values. */ + public static Collection values() { + return values(CertificateType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistries.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistries.java new file mode 100644 index 000000000000..72f0896fa569 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistries.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ConnectedRegistries. */ +public interface ConnectedRegistries { + /** + * Lists all connected registries for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all connected registries for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param filter An OData filter expression that describes a subset of connectedRegistries to return. The parameters + * that can be filtered are parent.id (the resource id of the connectedRegistry parent), mode, and + * connectionState. The supported operator is eq. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list connected registries for a container registry as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String registryName, String filter, Context context); + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry. + */ + ConnectedRegistry get(String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Gets the properties of the connected registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Deletes a connected registry from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deactivate(String resourceGroupName, String registryName, String connectedRegistryName); + + /** + * Deactivates the connected registry instance. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param connectedRegistryName The name of the connected registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deactivate(String resourceGroupName, String registryName, String connectedRegistryName, Context context); + + /** + * Gets the properties of the connected registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry along with {@link Response}. + */ + ConnectedRegistry getById(String id); + + /** + * Gets the properties of the connected registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the connected registry along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a connected registry from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a connected registry from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ConnectedRegistry resource. + * + * @param name resource name. + * @return the first stage of the new ConnectedRegistry definition. + */ + ConnectedRegistry.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistry.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistry.java new file mode 100644 index 000000000000..f4a00effaeae --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistry.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of ConnectedRegistry. */ +public interface ConnectedRegistry { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the mode property: The mode of the connected registry resource that indicates the permissions of the + * registry. + * + * @return the mode value. + */ + ConnectedRegistryMode mode(); + + /** + * Gets the version property: The current version of ACR runtime on the connected registry. + * + * @return the version value. + */ + String version(); + + /** + * Gets the connectionState property: The current connection state of the connected registry. + * + * @return the connectionState value. + */ + ConnectionState connectionState(); + + /** + * Gets the lastActivityTime property: The last activity time of the connected registry. + * + * @return the lastActivityTime value. + */ + OffsetDateTime lastActivityTime(); + + /** + * Gets the activation property: The activation properties of the connected registry. + * + * @return the activation value. + */ + ActivationProperties activation(); + + /** + * Gets the parent property: The parent of the connected registry. + * + * @return the parent value. + */ + ParentProperties parent(); + + /** + * Gets the clientTokenIds property: The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * + * @return the clientTokenIds value. + */ + List clientTokenIds(); + + /** + * Gets the loginServer property: The login server properties of the connected registry. + * + * @return the loginServer value. + */ + LoginServerProperties loginServer(); + + /** + * Gets the logging property: The logging properties of the connected registry. + * + * @return the logging value. + */ + LoggingProperties logging(); + + /** + * Gets the statusDetails property: The list of current statuses of the connected registry. + * + * @return the statusDetails value. + */ + List statusDetails(); + + /** + * Gets the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @return the notificationsList value. + */ + List notificationsList(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryInner object. + * + * @return the inner object. + */ + ConnectedRegistryInner innerModel(); + + /** The entirety of the ConnectedRegistry definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ConnectedRegistry definition stages. */ + interface DefinitionStages { + /** The first stage of the ConnectedRegistry definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ConnectedRegistry definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the ConnectedRegistry definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithMode, + DefinitionStages.WithParent, + DefinitionStages.WithClientTokenIds, + DefinitionStages.WithLoginServer, + DefinitionStages.WithLogging, + DefinitionStages.WithNotificationsList { + /** + * Executes the create request. + * + * @return the created resource. + */ + ConnectedRegistry create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ConnectedRegistry create(Context context); + } + /** The stage of the ConnectedRegistry definition allowing to specify mode. */ + interface WithMode { + /** + * Specifies the mode property: The mode of the connected registry resource that indicates the permissions + * of the registry.. + * + * @param mode The mode of the connected registry resource that indicates the permissions of the registry. + * @return the next definition stage. + */ + WithCreate withMode(ConnectedRegistryMode mode); + } + /** The stage of the ConnectedRegistry definition allowing to specify parent. */ + interface WithParent { + /** + * Specifies the parent property: The parent of the connected registry.. + * + * @param parent The parent of the connected registry. + * @return the next definition stage. + */ + WithCreate withParent(ParentProperties parent); + } + /** The stage of the ConnectedRegistry definition allowing to specify clientTokenIds. */ + interface WithClientTokenIds { + /** + * Specifies the clientTokenIds property: The list of the ACR token resource IDs used to authenticate + * clients to the connected registry.. + * + * @param clientTokenIds The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * @return the next definition stage. + */ + WithCreate withClientTokenIds(List clientTokenIds); + } + /** The stage of the ConnectedRegistry definition allowing to specify loginServer. */ + interface WithLoginServer { + /** + * Specifies the loginServer property: The login server properties of the connected registry.. + * + * @param loginServer The login server properties of the connected registry. + * @return the next definition stage. + */ + WithCreate withLoginServer(LoginServerProperties loginServer); + } + /** The stage of the ConnectedRegistry definition allowing to specify logging. */ + interface WithLogging { + /** + * Specifies the logging property: The logging properties of the connected registry.. + * + * @param logging The logging properties of the connected registry. + * @return the next definition stage. + */ + WithCreate withLogging(LoggingProperties logging); + } + /** The stage of the ConnectedRegistry definition allowing to specify notificationsList. */ + interface WithNotificationsList { + /** + * Specifies the notificationsList property: The list of notifications subscription information for the + * connected registry.. + * + * @param notificationsList The list of notifications subscription information for the connected registry. + * @return the next definition stage. + */ + WithCreate withNotificationsList(List notificationsList); + } + } + /** + * Begins update for the ConnectedRegistry resource. + * + * @return the stage of resource update. + */ + ConnectedRegistry.Update update(); + + /** The template for ConnectedRegistry update. */ + interface Update + extends UpdateStages.WithSyncProperties, + UpdateStages.WithLogging, + UpdateStages.WithClientTokenIds, + UpdateStages.WithNotificationsList { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ConnectedRegistry apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ConnectedRegistry apply(Context context); + } + /** The ConnectedRegistry update stages. */ + interface UpdateStages { + /** The stage of the ConnectedRegistry update allowing to specify syncProperties. */ + interface WithSyncProperties { + /** + * Specifies the syncProperties property: The sync properties of the connected registry with its parent.. + * + * @param syncProperties The sync properties of the connected registry with its parent. + * @return the next definition stage. + */ + Update withSyncProperties(SyncUpdateProperties syncProperties); + } + /** The stage of the ConnectedRegistry update allowing to specify logging. */ + interface WithLogging { + /** + * Specifies the logging property: The logging properties of the connected registry.. + * + * @param logging The logging properties of the connected registry. + * @return the next definition stage. + */ + Update withLogging(LoggingProperties logging); + } + /** The stage of the ConnectedRegistry update allowing to specify clientTokenIds. */ + interface WithClientTokenIds { + /** + * Specifies the clientTokenIds property: The list of the ACR token resource IDs used to authenticate + * clients to the connected registry.. + * + * @param clientTokenIds The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * @return the next definition stage. + */ + Update withClientTokenIds(List clientTokenIds); + } + /** The stage of the ConnectedRegistry update allowing to specify notificationsList. */ + interface WithNotificationsList { + /** + * Specifies the notificationsList property: The list of notifications subscription information for the + * connected registry.. + * + * @param notificationsList The list of notifications subscription information for the connected registry. + * @return the next definition stage. + */ + Update withNotificationsList(List notificationsList); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ConnectedRegistry refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ConnectedRegistry refresh(Context context); + + /** + * Deactivates the connected registry instance. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deactivate(); + + /** + * Deactivates the connected registry instance. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deactivate(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryListResult.java new file mode 100644 index 000000000000..e418ffde673b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryListResult.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list connected registries for a container registry. */ +@Fluent +public final class ConnectedRegistryListResult { + /* + * The list of connected registries. Since this list may be incomplete, the + * nextLink field should be used to request the next list of connected + * registries. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of connected + * registries. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of connected registries. Since this list may be incomplete, the nextLink field + * should be used to request the next list of connected registries. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of connected registries. Since this list may be incomplete, the nextLink field + * should be used to request the next list of connected registries. + * + * @param value the value value to set. + * @return the ConnectedRegistryListResult object itself. + */ + public ConnectedRegistryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of connected registries. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of connected registries. + * + * @param nextLink the nextLink value to set. + * @return the ConnectedRegistryListResult object itself. + */ + public ConnectedRegistryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryMode.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryMode.java new file mode 100644 index 000000000000..7c49b3d61335 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryMode.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectedRegistryMode. */ +public final class ConnectedRegistryMode extends ExpandableStringEnum { + /** Static value ReadWrite for ConnectedRegistryMode. */ + public static final ConnectedRegistryMode READ_WRITE = fromString("ReadWrite"); + + /** Static value ReadOnly for ConnectedRegistryMode. */ + public static final ConnectedRegistryMode READ_ONLY = fromString("ReadOnly"); + + /** Static value Registry for ConnectedRegistryMode. */ + public static final ConnectedRegistryMode REGISTRY = fromString("Registry"); + + /** Static value Mirror for ConnectedRegistryMode. */ + public static final ConnectedRegistryMode MIRROR = fromString("Mirror"); + + /** + * Creates or finds a ConnectedRegistryMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectedRegistryMode. + */ + @JsonCreator + public static ConnectedRegistryMode fromString(String name) { + return fromString(name, ConnectedRegistryMode.class); + } + + /** @return known ConnectedRegistryMode values. */ + public static Collection values() { + return values(ConnectedRegistryMode.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryUpdateParameters.java new file mode 100644 index 000000000000..5c0375e2677b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectedRegistryUpdateParameters.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ConnectedRegistryUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The parameters for updating a connected registry. */ +@Fluent +public final class ConnectedRegistryUpdateParameters { + /* + * The properties of the connected registry update parameters. + */ + @JsonProperty(value = "properties") + private ConnectedRegistryUpdateProperties innerProperties; + + /** + * Get the innerProperties property: The properties of the connected registry update parameters. + * + * @return the innerProperties value. + */ + private ConnectedRegistryUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the syncProperties property: The sync properties of the connected registry with its parent. + * + * @return the syncProperties value. + */ + public SyncUpdateProperties syncProperties() { + return this.innerProperties() == null ? null : this.innerProperties().syncProperties(); + } + + /** + * Set the syncProperties property: The sync properties of the connected registry with its parent. + * + * @param syncProperties the syncProperties value to set. + * @return the ConnectedRegistryUpdateParameters object itself. + */ + public ConnectedRegistryUpdateParameters withSyncProperties(SyncUpdateProperties syncProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryUpdateProperties(); + } + this.innerProperties().withSyncProperties(syncProperties); + return this; + } + + /** + * Get the logging property: The logging properties of the connected registry. + * + * @return the logging value. + */ + public LoggingProperties logging() { + return this.innerProperties() == null ? null : this.innerProperties().logging(); + } + + /** + * Set the logging property: The logging properties of the connected registry. + * + * @param logging the logging value to set. + * @return the ConnectedRegistryUpdateParameters object itself. + */ + public ConnectedRegistryUpdateParameters withLogging(LoggingProperties logging) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryUpdateProperties(); + } + this.innerProperties().withLogging(logging); + return this; + } + + /** + * Get the clientTokenIds property: The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * + * @return the clientTokenIds value. + */ + public List clientTokenIds() { + return this.innerProperties() == null ? null : this.innerProperties().clientTokenIds(); + } + + /** + * Set the clientTokenIds property: The list of the ACR token resource IDs used to authenticate clients to the + * connected registry. + * + * @param clientTokenIds the clientTokenIds value to set. + * @return the ConnectedRegistryUpdateParameters object itself. + */ + public ConnectedRegistryUpdateParameters withClientTokenIds(List clientTokenIds) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryUpdateProperties(); + } + this.innerProperties().withClientTokenIds(clientTokenIds); + return this; + } + + /** + * Get the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @return the notificationsList value. + */ + public List notificationsList() { + return this.innerProperties() == null ? null : this.innerProperties().notificationsList(); + } + + /** + * Set the notificationsList property: The list of notifications subscription information for the connected + * registry. + * + * @param notificationsList the notificationsList value to set. + * @return the ConnectedRegistryUpdateParameters object itself. + */ + public ConnectedRegistryUpdateParameters withNotificationsList(List notificationsList) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectedRegistryUpdateProperties(); + } + this.innerProperties().withNotificationsList(notificationsList); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionState.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionState.java new file mode 100644 index 000000000000..770d94f47877 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionState. */ +public final class ConnectionState extends ExpandableStringEnum { + /** Static value Online for ConnectionState. */ + public static final ConnectionState ONLINE = fromString("Online"); + + /** Static value Offline for ConnectionState. */ + public static final ConnectionState OFFLINE = fromString("Offline"); + + /** Static value Syncing for ConnectionState. */ + public static final ConnectionState SYNCING = fromString("Syncing"); + + /** Static value Unhealthy for ConnectionState. */ + public static final ConnectionState UNHEALTHY = fromString("Unhealthy"); + + /** + * Creates or finds a ConnectionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionState. + */ + @JsonCreator + public static ConnectionState fromString(String name) { + return fromString(name, ConnectionState.class); + } + + /** @return known ConnectionState values. */ + public static Collection values() { + return values(ConnectionState.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionStatus.java new file mode 100644 index 000000000000..dda6853de59f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ConnectionStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionStatus. */ +public final class ConnectionStatus extends ExpandableStringEnum { + /** Static value Approved for ConnectionStatus. */ + public static final ConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Pending for ConnectionStatus. */ + public static final ConnectionStatus PENDING = fromString("Pending"); + + /** Static value Rejected for ConnectionStatus. */ + public static final ConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for ConnectionStatus. */ + public static final ConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a ConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionStatus. + */ + @JsonCreator + public static ConnectionStatus fromString(String name) { + return fromString(name, ConnectionStatus.class); + } + + /** @return known ConnectionStatus values. */ + public static Collection values() { + return values(ConnectionStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DefaultAction.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DefaultAction.java new file mode 100644 index 000000000000..02ecaf84c952 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/DefaultAction.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DefaultAction. */ +public final class DefaultAction extends ExpandableStringEnum { + /** Static value Allow for DefaultAction. */ + public static final DefaultAction ALLOW = fromString("Allow"); + + /** Static value Deny for DefaultAction. */ + public static final DefaultAction DENY = fromString("Deny"); + + /** + * Creates or finds a DefaultAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding DefaultAction. + */ + @JsonCreator + public static DefaultAction fromString(String name) { + return fromString(name, DefaultAction.class); + } + + /** @return known DefaultAction values. */ + public static Collection values() { + return values(DefaultAction.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionProperty.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionProperty.java new file mode 100644 index 000000000000..7d8c9a276262 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionProperty.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The EncryptionProperty model. */ +@Fluent +public final class EncryptionProperty { + /* + * Indicates whether or not the encryption is enabled for container + * registry. + */ + @JsonProperty(value = "status") + private EncryptionStatus status; + + /* + * Key vault properties. + */ + @JsonProperty(value = "keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /** + * Get the status property: Indicates whether or not the encryption is enabled for container registry. + * + * @return the status value. + */ + public EncryptionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether or not the encryption is enabled for container registry. + * + * @param status the status value to set. + * @return the EncryptionProperty object itself. + */ + public EncryptionProperty withStatus(EncryptionStatus status) { + this.status = status; + return this; + } + + /** + * Get the keyVaultProperties property: Key vault properties. + * + * @return the keyVaultProperties value. + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: Key vault properties. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the EncryptionProperty object itself. + */ + public EncryptionProperty withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionStatus.java new file mode 100644 index 000000000000..cf463d385e27 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EncryptionStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EncryptionStatus. */ +public final class EncryptionStatus extends ExpandableStringEnum { + /** Static value enabled for EncryptionStatus. */ + public static final EncryptionStatus ENABLED = fromString("enabled"); + + /** Static value disabled for EncryptionStatus. */ + public static final EncryptionStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a EncryptionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionStatus. + */ + @JsonCreator + public static EncryptionStatus fromString(String name) { + return fromString(name, EncryptionStatus.class); + } + + /** @return known EncryptionStatus values. */ + public static Collection values() { + return values(EncryptionStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Event.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Event.java new file mode 100644 index 000000000000..69e5ea4ff136 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Event.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInner; + +/** An immutable client-side representation of Event. */ +public interface Event { + /** + * Gets the id property: The event ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the eventRequestMessage property: The event request message sent to the service URI. + * + * @return the eventRequestMessage value. + */ + EventRequestMessage eventRequestMessage(); + + /** + * Gets the eventResponseMessage property: The event response message received from the service URI. + * + * @return the eventResponseMessage value. + */ + EventResponseMessage eventResponseMessage(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInner object. + * + * @return the inner object. + */ + EventInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventContent.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventContent.java new file mode 100644 index 000000000000..5fda75e36d7a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventContent.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The content of the event request message. */ +@Fluent +public final class EventContent { + /* + * The event ID. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The time at which the event occurred. + */ + @JsonProperty(value = "timestamp") + private OffsetDateTime timestamp; + + /* + * The action that encompasses the provided event. + */ + @JsonProperty(value = "action") + private String action; + + /* + * The target of the event. + */ + @JsonProperty(value = "target") + private Target target; + + /* + * The request that generated the event. + */ + @JsonProperty(value = "request") + private Request request; + + /* + * The agent that initiated the event. For most situations, this could be + * from the authorization context of the request. + */ + @JsonProperty(value = "actor") + private Actor actor; + + /* + * The registry node that generated the event. Put differently, while the + * actor initiates the event, the source generates it. + */ + @JsonProperty(value = "source") + private Source source; + + /** + * Get the id property: The event ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The event ID. + * + * @param id the id value to set. + * @return the EventContent object itself. + */ + public EventContent withId(String id) { + this.id = id; + return this; + } + + /** + * Get the timestamp property: The time at which the event occurred. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp property: The time at which the event occurred. + * + * @param timestamp the timestamp value to set. + * @return the EventContent object itself. + */ + public EventContent withTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the action property: The action that encompasses the provided event. + * + * @return the action value. + */ + public String action() { + return this.action; + } + + /** + * Set the action property: The action that encompasses the provided event. + * + * @param action the action value to set. + * @return the EventContent object itself. + */ + public EventContent withAction(String action) { + this.action = action; + return this; + } + + /** + * Get the target property: The target of the event. + * + * @return the target value. + */ + public Target target() { + return this.target; + } + + /** + * Set the target property: The target of the event. + * + * @param target the target value to set. + * @return the EventContent object itself. + */ + public EventContent withTarget(Target target) { + this.target = target; + return this; + } + + /** + * Get the request property: The request that generated the event. + * + * @return the request value. + */ + public Request request() { + return this.request; + } + + /** + * Set the request property: The request that generated the event. + * + * @param request the request value to set. + * @return the EventContent object itself. + */ + public EventContent withRequest(Request request) { + this.request = request; + return this; + } + + /** + * Get the actor property: The agent that initiated the event. For most situations, this could be from the + * authorization context of the request. + * + * @return the actor value. + */ + public Actor actor() { + return this.actor; + } + + /** + * Set the actor property: The agent that initiated the event. For most situations, this could be from the + * authorization context of the request. + * + * @param actor the actor value to set. + * @return the EventContent object itself. + */ + public EventContent withActor(Actor actor) { + this.actor = actor; + return this; + } + + /** + * Get the source property: The registry node that generated the event. Put differently, while the actor initiates + * the event, the source generates it. + * + * @return the source value. + */ + public Source source() { + return this.source; + } + + /** + * Set the source property: The registry node that generated the event. Put differently, while the actor initiates + * the event, the source generates it. + * + * @param source the source value to set. + * @return the EventContent object itself. + */ + public EventContent withSource(Source source) { + this.source = source; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (target() != null) { + target().validate(); + } + if (request() != null) { + request().validate(); + } + if (actor() != null) { + actor().validate(); + } + if (source() != null) { + source().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventInfo.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventInfo.java new file mode 100644 index 000000000000..82217118396b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventInfo.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInfoInner; + +/** An immutable client-side representation of EventInfo. */ +public interface EventInfo { + /** + * Gets the id property: The event ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInfoInner object. + * + * @return the inner object. + */ + EventInfoInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventListResult.java new file mode 100644 index 000000000000..2e6fa5d26a68 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventListResult.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.EventInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list events for a webhook. */ +@Fluent +public final class EventListResult { + /* + * The list of events. Since this list may be incomplete, the nextLink + * field should be used to request the next list of events. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of events. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of events. Since this list may be incomplete, the nextLink field should be used + * to request the next list of events. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of events. Since this list may be incomplete, the nextLink field should be used + * to request the next list of events. + * + * @param value the value value to set. + * @return the EventListResult object itself. + */ + public EventListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of events. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of events. + * + * @param nextLink the nextLink value to set. + * @return the EventListResult object itself. + */ + public EventListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventRequestMessage.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventRequestMessage.java new file mode 100644 index 000000000000..f3d0f86ab501 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventRequestMessage.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The event request message sent to the service URI. */ +@Fluent +public final class EventRequestMessage { + /* + * The content of the event request message. + */ + @JsonProperty(value = "content") + private EventContent content; + + /* + * The headers of the event request message. + */ + @JsonProperty(value = "headers") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map headers; + + /* + * The HTTP method used to send the event request message. + */ + @JsonProperty(value = "method") + private String method; + + /* + * The URI used to send the event request message. + */ + @JsonProperty(value = "requestUri") + private String requestUri; + + /* + * The HTTP message version. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the content property: The content of the event request message. + * + * @return the content value. + */ + public EventContent content() { + return this.content; + } + + /** + * Set the content property: The content of the event request message. + * + * @param content the content value to set. + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withContent(EventContent content) { + this.content = content; + return this; + } + + /** + * Get the headers property: The headers of the event request message. + * + * @return the headers value. + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers property: The headers of the event request message. + * + * @param headers the headers value to set. + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the method property: The HTTP method used to send the event request message. + * + * @return the method value. + */ + public String method() { + return this.method; + } + + /** + * Set the method property: The HTTP method used to send the event request message. + * + * @param method the method value to set. + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the requestUri property: The URI used to send the event request message. + * + * @return the requestUri value. + */ + public String requestUri() { + return this.requestUri; + } + + /** + * Set the requestUri property: The URI used to send the event request message. + * + * @param requestUri the requestUri value to set. + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withRequestUri(String requestUri) { + this.requestUri = requestUri; + return this; + } + + /** + * Get the version property: The HTTP message version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The HTTP message version. + * + * @param version the version value to set. + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (content() != null) { + content().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventResponseMessage.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventResponseMessage.java new file mode 100644 index 000000000000..7e059fbc63f1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/EventResponseMessage.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The event response message received from the service URI. */ +@Fluent +public final class EventResponseMessage { + /* + * The content of the event response message. + */ + @JsonProperty(value = "content") + private String content; + + /* + * The headers of the event response message. + */ + @JsonProperty(value = "headers") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map headers; + + /* + * The reason phrase of the event response message. + */ + @JsonProperty(value = "reasonPhrase") + private String reasonPhrase; + + /* + * The status code of the event response message. + */ + @JsonProperty(value = "statusCode") + private String statusCode; + + /* + * The HTTP message version. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the content property: The content of the event response message. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: The content of the event response message. + * + * @param content the content value to set. + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the headers property: The headers of the event response message. + * + * @return the headers value. + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers property: The headers of the event response message. + * + * @param headers the headers value to set. + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the reasonPhrase property: The reason phrase of the event response message. + * + * @return the reasonPhrase value. + */ + public String reasonPhrase() { + return this.reasonPhrase; + } + + /** + * Set the reasonPhrase property: The reason phrase of the event response message. + * + * @param reasonPhrase the reasonPhrase value to set. + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withReasonPhrase(String reasonPhrase) { + this.reasonPhrase = reasonPhrase; + return this; + } + + /** + * Get the statusCode property: The status code of the event response message. + * + * @return the statusCode value. + */ + public String statusCode() { + return this.statusCode; + } + + /** + * Set the statusCode property: The status code of the event response message. + * + * @param statusCode the statusCode value to set. + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withStatusCode(String statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Get the version property: The HTTP message version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The HTTP message version. + * + * @param version the version value to set. + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipeline.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipeline.java new file mode 100644 index 000000000000..cbd316cc5f64 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipeline.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ExportPipelineInner; +import java.util.List; + +/** An immutable client-side representation of ExportPipeline. */ +public interface ExportPipeline { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The location of the export pipeline. + * + * @return the location value. + */ + String location(); + + /** + * Gets the identity property: The identity of the export pipeline. + * + * @return the identity value. + */ + IdentityProperties identity(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the target property: The target properties of the export pipeline. + * + * @return the target value. + */ + ExportPipelineTargetProperties target(); + + /** + * Gets the options property: The list of all options configured for the pipeline. + * + * @return the options value. + */ + List options(); + + /** + * Gets the provisioningState property: The provisioning state of the pipeline at the time the operation was called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.ExportPipelineInner object. + * + * @return the inner object. + */ + ExportPipelineInner innerModel(); + + /** The entirety of the ExportPipeline definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ExportPipeline definition stages. */ + interface DefinitionStages { + /** The first stage of the ExportPipeline definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ExportPipeline definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the ExportPipeline definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, + DefinitionStages.WithIdentity, + DefinitionStages.WithTarget, + DefinitionStages.WithOptions { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExportPipeline create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExportPipeline create(Context context); + } + /** The stage of the ExportPipeline definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location of the export pipeline. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location of the export pipeline. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the ExportPipeline definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the export pipeline.. + * + * @param identity The identity of the export pipeline. + * @return the next definition stage. + */ + WithCreate withIdentity(IdentityProperties identity); + } + /** The stage of the ExportPipeline definition allowing to specify target. */ + interface WithTarget { + /** + * Specifies the target property: The target properties of the export pipeline.. + * + * @param target The target properties of the export pipeline. + * @return the next definition stage. + */ + WithCreate withTarget(ExportPipelineTargetProperties target); + } + /** The stage of the ExportPipeline definition allowing to specify options. */ + interface WithOptions { + /** + * Specifies the options property: The list of all options configured for the pipeline.. + * + * @param options The list of all options configured for the pipeline. + * @return the next definition stage. + */ + WithCreate withOptions(List options); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExportPipeline refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExportPipeline refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineListResult.java new file mode 100644 index 000000000000..d3ecf04b8829 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ExportPipelineInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list export pipelines for a container registry. */ +@Fluent +public final class ExportPipelineListResult { + /* + * The list of export pipelines. Since this list may be incomplete, the + * nextLink field should be used to request the next list of export + * pipelines. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of pipeline runs. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of export pipelines. Since this list may be incomplete, the nextLink field + * should be used to request the next list of export pipelines. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of export pipelines. Since this list may be incomplete, the nextLink field + * should be used to request the next list of export pipelines. + * + * @param value the value value to set. + * @return the ExportPipelineListResult object itself. + */ + public ExportPipelineListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of pipeline runs. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of pipeline runs. + * + * @param nextLink the nextLink value to set. + * @return the ExportPipelineListResult object itself. + */ + public ExportPipelineListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineTargetProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineTargetProperties.java new file mode 100644 index 000000000000..8bd3c82f6169 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelineTargetProperties.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the export pipeline target. */ +@Fluent +public final class ExportPipelineTargetProperties { + /* + * The type of target for the export pipeline. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The target uri of the export pipeline. + * When 'AzureStorageBlob': + * "https://accountName.blob.core.windows.net/containerName/blobName" + * When 'AzureStorageBlobContainer': + * "https://accountName.blob.core.windows.net/containerName" + */ + @JsonProperty(value = "uri") + private String uri; + + /* + * They key vault secret uri to obtain the target storage SAS token. + */ + @JsonProperty(value = "keyVaultUri", required = true) + private String keyVaultUri; + + /** + * Get the type property: The type of target for the export pipeline. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of target for the export pipeline. + * + * @param type the type value to set. + * @return the ExportPipelineTargetProperties object itself. + */ + public ExportPipelineTargetProperties withType(String type) { + this.type = type; + return this; + } + + /** + * Get the uri property: The target uri of the export pipeline. When 'AzureStorageBlob': + * "https://accountName.blob.core.windows.net/containerName/blobName" When 'AzureStorageBlobContainer': + * "https://accountName.blob.core.windows.net/containerName". + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The target uri of the export pipeline. When 'AzureStorageBlob': + * "https://accountName.blob.core.windows.net/containerName/blobName" When 'AzureStorageBlobContainer': + * "https://accountName.blob.core.windows.net/containerName". + * + * @param uri the uri value to set. + * @return the ExportPipelineTargetProperties object itself. + */ + public ExportPipelineTargetProperties withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the keyVaultUri property: They key vault secret uri to obtain the target storage SAS token. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: They key vault secret uri to obtain the target storage SAS token. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the ExportPipelineTargetProperties object itself. + */ + public ExportPipelineTargetProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultUri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyVaultUri in model ExportPipelineTargetProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExportPipelineTargetProperties.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelines.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelines.java new file mode 100644 index 000000000000..e0b04ad7b123 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPipelines.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExportPipelines. */ +public interface ExportPipelines { + /** + * Lists all export pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all export pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list export pipelines for a container registry as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline. + */ + ExportPipeline get(String resourceGroupName, String registryName, String exportPipelineName); + + /** + * Gets the properties of the export pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String exportPipelineName, Context context); + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String exportPipelineName); + + /** + * Deletes an export pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param exportPipelineName The name of the export pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String exportPipelineName, Context context); + + /** + * Gets the properties of the export pipeline. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline along with {@link Response}. + */ + ExportPipeline getById(String id); + + /** + * Gets the properties of the export pipeline. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the export pipeline along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an export pipeline from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an export pipeline from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ExportPipeline resource. + * + * @param name resource name. + * @return the first stage of the new ExportPipeline definition. + */ + ExportPipeline.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPolicy.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPolicy.java new file mode 100644 index 000000000000..055681505f05 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPolicy.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The export policy for a container registry. */ +@Fluent +public final class ExportPolicy { + /* + * The value that indicates whether the policy is enabled or not. + */ + @JsonProperty(value = "status") + private ExportPolicyStatus status; + + /** + * Get the status property: The value that indicates whether the policy is enabled or not. + * + * @return the status value. + */ + public ExportPolicyStatus status() { + return this.status; + } + + /** + * Set the status property: The value that indicates whether the policy is enabled or not. + * + * @param status the status value to set. + * @return the ExportPolicy object itself. + */ + public ExportPolicy withStatus(ExportPolicyStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPolicyStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPolicyStatus.java new file mode 100644 index 000000000000..e02f9b19322d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ExportPolicyStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExportPolicyStatus. */ +public final class ExportPolicyStatus extends ExpandableStringEnum { + /** Static value enabled for ExportPolicyStatus. */ + public static final ExportPolicyStatus ENABLED = fromString("enabled"); + + /** Static value disabled for ExportPolicyStatus. */ + public static final ExportPolicyStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a ExportPolicyStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExportPolicyStatus. + */ + @JsonCreator + public static ExportPolicyStatus fromString(String name) { + return fromString(name, ExportPolicyStatus.class); + } + + /** @return known ExportPolicyStatus values. */ + public static Collection values() { + return values(ExportPolicyStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/GenerateCredentialsParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/GenerateCredentialsParameters.java new file mode 100644 index 000000000000..fcf0af1fd388 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/GenerateCredentialsParameters.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The parameters used to generate credentials for a specified token or user of a container registry. */ +@Fluent +public final class GenerateCredentialsParameters { + /* + * The resource ID of the token for which credentials have to be generated. + */ + @JsonProperty(value = "tokenId") + private String tokenId; + + /* + * The expiry date of the generated credentials after which the credentials + * become invalid. + */ + @JsonProperty(value = "expiry") + private OffsetDateTime expiry; + + /* + * Specifies name of the password which should be regenerated if any -- + * password1 or password2. + */ + @JsonProperty(value = "name") + private TokenPasswordName name; + + /** + * Get the tokenId property: The resource ID of the token for which credentials have to be generated. + * + * @return the tokenId value. + */ + public String tokenId() { + return this.tokenId; + } + + /** + * Set the tokenId property: The resource ID of the token for which credentials have to be generated. + * + * @param tokenId the tokenId value to set. + * @return the GenerateCredentialsParameters object itself. + */ + public GenerateCredentialsParameters withTokenId(String tokenId) { + this.tokenId = tokenId; + return this; + } + + /** + * Get the expiry property: The expiry date of the generated credentials after which the credentials become invalid. + * + * @return the expiry value. + */ + public OffsetDateTime expiry() { + return this.expiry; + } + + /** + * Set the expiry property: The expiry date of the generated credentials after which the credentials become invalid. + * + * @param expiry the expiry value to set. + * @return the GenerateCredentialsParameters object itself. + */ + public GenerateCredentialsParameters withExpiry(OffsetDateTime expiry) { + this.expiry = expiry; + return this; + } + + /** + * Get the name property: Specifies name of the password which should be regenerated if any -- password1 or + * password2. + * + * @return the name value. + */ + public TokenPasswordName name() { + return this.name; + } + + /** + * Set the name property: Specifies name of the password which should be regenerated if any -- password1 or + * password2. + * + * @param name the name value to set. + * @return the GenerateCredentialsParameters object itself. + */ + public GenerateCredentialsParameters withName(TokenPasswordName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/GenerateCredentialsResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/GenerateCredentialsResult.java new file mode 100644 index 000000000000..1243265f7e4e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/GenerateCredentialsResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.GenerateCredentialsResultInner; +import java.util.List; + +/** An immutable client-side representation of GenerateCredentialsResult. */ +public interface GenerateCredentialsResult { + /** + * Gets the username property: The username for a container registry. + * + * @return the username value. + */ + String username(); + + /** + * Gets the passwords property: The list of passwords for a container registry. + * + * @return the passwords value. + */ + List passwords(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.GenerateCredentialsResultInner + * object. + * + * @return the inner object. + */ + GenerateCredentialsResultInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IdentityProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IdentityProperties.java new file mode 100644 index 000000000000..df1e8b50a530 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IdentityProperties.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Managed identity for the resource. */ +@Fluent +public final class IdentityProperties { + /* + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * The identity type. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /* + * The list of user identities associated with the resource. The user + * identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID of resource identity. + * + * @param principalId the principalId value to set. + * @return the IdentityProperties object itself. + */ + public IdentityProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the tenantId property: The tenant ID of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant ID of resource. + * + * @param tenantId the tenantId value to set. + * @return the IdentityProperties object itself. + */ + public IdentityProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the type property: The identity type. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The identity type. + * + * @param type the type value to set. + * @return the IdentityProperties object itself. + */ + public IdentityProperties withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the IdentityProperties object itself. + */ + public IdentityProperties withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportImageParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportImageParameters.java new file mode 100644 index 000000000000..e955116da76b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportImageParameters.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ImportImageParameters model. */ +@Fluent +public final class ImportImageParameters { + /* + * The source of the image. + */ + @JsonProperty(value = "source", required = true) + private ImportSource source; + + /* + * List of strings of the form repo[:tag]. When tag is omitted the source + * will be used (or 'latest' if source tag is also omitted). + */ + @JsonProperty(value = "targetTags") + private List targetTags; + + /* + * List of strings of repository names to do a manifest only copy. No tag + * will be created. + */ + @JsonProperty(value = "untaggedTargetRepositories") + private List untaggedTargetRepositories; + + /* + * When Force, any existing target tags will be overwritten. When NoForce, + * any existing target tags will fail the operation before any copying + * begins. + */ + @JsonProperty(value = "mode") + private ImportMode mode; + + /** + * Get the source property: The source of the image. + * + * @return the source value. + */ + public ImportSource source() { + return this.source; + } + + /** + * Set the source property: The source of the image. + * + * @param source the source value to set. + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withSource(ImportSource source) { + this.source = source; + return this; + } + + /** + * Get the targetTags property: List of strings of the form repo[:tag]. When tag is omitted the source will be used + * (or 'latest' if source tag is also omitted). + * + * @return the targetTags value. + */ + public List targetTags() { + return this.targetTags; + } + + /** + * Set the targetTags property: List of strings of the form repo[:tag]. When tag is omitted the source will be used + * (or 'latest' if source tag is also omitted). + * + * @param targetTags the targetTags value to set. + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withTargetTags(List targetTags) { + this.targetTags = targetTags; + return this; + } + + /** + * Get the untaggedTargetRepositories property: List of strings of repository names to do a manifest only copy. No + * tag will be created. + * + * @return the untaggedTargetRepositories value. + */ + public List untaggedTargetRepositories() { + return this.untaggedTargetRepositories; + } + + /** + * Set the untaggedTargetRepositories property: List of strings of repository names to do a manifest only copy. No + * tag will be created. + * + * @param untaggedTargetRepositories the untaggedTargetRepositories value to set. + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withUntaggedTargetRepositories(List untaggedTargetRepositories) { + this.untaggedTargetRepositories = untaggedTargetRepositories; + return this; + } + + /** + * Get the mode property: When Force, any existing target tags will be overwritten. When NoForce, any existing + * target tags will fail the operation before any copying begins. + * + * @return the mode value. + */ + public ImportMode mode() { + return this.mode; + } + + /** + * Set the mode property: When Force, any existing target tags will be overwritten. When NoForce, any existing + * target tags will fail the operation before any copying begins. + * + * @param mode the mode value to set. + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withMode(ImportMode mode) { + this.mode = mode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property source in model ImportImageParameters")); + } else { + source().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImportImageParameters.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportMode.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportMode.java new file mode 100644 index 000000000000..70b0ad906c51 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ImportMode. */ +public final class ImportMode extends ExpandableStringEnum { + /** Static value NoForce for ImportMode. */ + public static final ImportMode NO_FORCE = fromString("NoForce"); + + /** Static value Force for ImportMode. */ + public static final ImportMode FORCE = fromString("Force"); + + /** + * Creates or finds a ImportMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImportMode. + */ + @JsonCreator + public static ImportMode fromString(String name) { + return fromString(name, ImportMode.class); + } + + /** @return known ImportMode values. */ + public static Collection values() { + return values(ImportMode.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipeline.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipeline.java new file mode 100644 index 000000000000..67cf07deb7ae --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipeline.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ImportPipelineInner; +import java.util.List; + +/** An immutable client-side representation of ImportPipeline. */ +public interface ImportPipeline { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The location of the import pipeline. + * + * @return the location value. + */ + String location(); + + /** + * Gets the identity property: The identity of the import pipeline. + * + * @return the identity value. + */ + IdentityProperties identity(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the source property: The source properties of the import pipeline. + * + * @return the source value. + */ + ImportPipelineSourceProperties source(); + + /** + * Gets the trigger property: The properties that describe the trigger of the import pipeline. + * + * @return the trigger value. + */ + PipelineTriggerProperties trigger(); + + /** + * Gets the options property: The list of all options configured for the pipeline. + * + * @return the options value. + */ + List options(); + + /** + * Gets the provisioningState property: The provisioning state of the pipeline at the time the operation was called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.ImportPipelineInner object. + * + * @return the inner object. + */ + ImportPipelineInner innerModel(); + + /** The entirety of the ImportPipeline definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ImportPipeline definition stages. */ + interface DefinitionStages { + /** The first stage of the ImportPipeline definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ImportPipeline definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the ImportPipeline definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLocation, + DefinitionStages.WithIdentity, + DefinitionStages.WithSource, + DefinitionStages.WithTrigger, + DefinitionStages.WithOptions { + /** + * Executes the create request. + * + * @return the created resource. + */ + ImportPipeline create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ImportPipeline create(Context context); + } + /** The stage of the ImportPipeline definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location of the import pipeline. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location of the import pipeline. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the ImportPipeline definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the import pipeline.. + * + * @param identity The identity of the import pipeline. + * @return the next definition stage. + */ + WithCreate withIdentity(IdentityProperties identity); + } + /** The stage of the ImportPipeline definition allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: The source properties of the import pipeline.. + * + * @param source The source properties of the import pipeline. + * @return the next definition stage. + */ + WithCreate withSource(ImportPipelineSourceProperties source); + } + /** The stage of the ImportPipeline definition allowing to specify trigger. */ + interface WithTrigger { + /** + * Specifies the trigger property: The properties that describe the trigger of the import pipeline.. + * + * @param trigger The properties that describe the trigger of the import pipeline. + * @return the next definition stage. + */ + WithCreate withTrigger(PipelineTriggerProperties trigger); + } + /** The stage of the ImportPipeline definition allowing to specify options. */ + interface WithOptions { + /** + * Specifies the options property: The list of all options configured for the pipeline.. + * + * @param options The list of all options configured for the pipeline. + * @return the next definition stage. + */ + WithCreate withOptions(List options); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ImportPipeline refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ImportPipeline refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineListResult.java new file mode 100644 index 000000000000..44cc1f34b3ba --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ImportPipelineInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list import pipelines for a container registry. */ +@Fluent +public final class ImportPipelineListResult { + /* + * The list of import pipelines. Since this list may be incomplete, the + * nextLink field should be used to request the next list of import + * pipelines. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of pipeline runs. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of import pipelines. Since this list may be incomplete, the nextLink field + * should be used to request the next list of import pipelines. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of import pipelines. Since this list may be incomplete, the nextLink field + * should be used to request the next list of import pipelines. + * + * @param value the value value to set. + * @return the ImportPipelineListResult object itself. + */ + public ImportPipelineListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of pipeline runs. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of pipeline runs. + * + * @param nextLink the nextLink value to set. + * @return the ImportPipelineListResult object itself. + */ + public ImportPipelineListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineSourceProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineSourceProperties.java new file mode 100644 index 000000000000..7f8da25c5280 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelineSourceProperties.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the import pipeline source. */ +@Fluent +public final class ImportPipelineSourceProperties { + /* + * The type of source for the import pipeline. + */ + @JsonProperty(value = "type") + private PipelineSourceType type; + + /* + * The source uri of the import pipeline. + * When 'AzureStorageBlob': + * "https://accountName.blob.core.windows.net/containerName/blobName" + * When 'AzureStorageBlobContainer': + * "https://accountName.blob.core.windows.net/containerName" + */ + @JsonProperty(value = "uri") + private String uri; + + /* + * They key vault secret uri to obtain the source storage SAS token. + */ + @JsonProperty(value = "keyVaultUri", required = true) + private String keyVaultUri; + + /** + * Get the type property: The type of source for the import pipeline. + * + * @return the type value. + */ + public PipelineSourceType type() { + return this.type; + } + + /** + * Set the type property: The type of source for the import pipeline. + * + * @param type the type value to set. + * @return the ImportPipelineSourceProperties object itself. + */ + public ImportPipelineSourceProperties withType(PipelineSourceType type) { + this.type = type; + return this; + } + + /** + * Get the uri property: The source uri of the import pipeline. When 'AzureStorageBlob': + * "https://accountName.blob.core.windows.net/containerName/blobName" When 'AzureStorageBlobContainer': + * "https://accountName.blob.core.windows.net/containerName". + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The source uri of the import pipeline. When 'AzureStorageBlob': + * "https://accountName.blob.core.windows.net/containerName/blobName" When 'AzureStorageBlobContainer': + * "https://accountName.blob.core.windows.net/containerName". + * + * @param uri the uri value to set. + * @return the ImportPipelineSourceProperties object itself. + */ + public ImportPipelineSourceProperties withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the keyVaultUri property: They key vault secret uri to obtain the source storage SAS token. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: They key vault secret uri to obtain the source storage SAS token. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the ImportPipelineSourceProperties object itself. + */ + public ImportPipelineSourceProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultUri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyVaultUri in model ImportPipelineSourceProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImportPipelineSourceProperties.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelines.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelines.java new file mode 100644 index 000000000000..c9038a805849 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportPipelines.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ImportPipelines. */ +public interface ImportPipelines { + /** + * Lists all import pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all import pipelines for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list import pipelines for a container registry as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline. + */ + ImportPipeline get(String resourceGroupName, String registryName, String importPipelineName); + + /** + * Gets the properties of the import pipeline. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String importPipelineName, Context context); + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String importPipelineName); + + /** + * Deletes an import pipeline from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param importPipelineName The name of the import pipeline. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String importPipelineName, Context context); + + /** + * Gets the properties of the import pipeline. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline along with {@link Response}. + */ + ImportPipeline getById(String id); + + /** + * Gets the properties of the import pipeline. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the import pipeline along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an import pipeline from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes an import pipeline from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ImportPipeline resource. + * + * @param name resource name. + * @return the first stage of the new ImportPipeline definition. + */ + ImportPipeline.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSource.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSource.java new file mode 100644 index 000000000000..ff146432a780 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSource.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ImportSource model. */ +@Fluent +public final class ImportSource { + /* + * The resource identifier of the source Azure Container Registry. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The address of the source registry (e.g. 'mcr.microsoft.com'). + */ + @JsonProperty(value = "registryUri") + private String registryUri; + + /* + * Credentials used when importing from a registry uri. + */ + @JsonProperty(value = "credentials") + private ImportSourceCredentials credentials; + + /* + * Repository name of the source image. + * Specify an image by repository ('hello-world'). This will use the + * 'latest' tag. + * Specify an image by tag ('hello-world:latest'). + * Specify an image by sha256-based manifest digest + * ('hello-world@sha256:abc123'). + */ + @JsonProperty(value = "sourceImage", required = true) + private String sourceImage; + + /** + * Get the resourceId property: The resource identifier of the source Azure Container Registry. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource identifier of the source Azure Container Registry. + * + * @param resourceId the resourceId value to set. + * @return the ImportSource object itself. + */ + public ImportSource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the registryUri property: The address of the source registry (e.g. 'mcr.microsoft.com'). + * + * @return the registryUri value. + */ + public String registryUri() { + return this.registryUri; + } + + /** + * Set the registryUri property: The address of the source registry (e.g. 'mcr.microsoft.com'). + * + * @param registryUri the registryUri value to set. + * @return the ImportSource object itself. + */ + public ImportSource withRegistryUri(String registryUri) { + this.registryUri = registryUri; + return this; + } + + /** + * Get the credentials property: Credentials used when importing from a registry uri. + * + * @return the credentials value. + */ + public ImportSourceCredentials credentials() { + return this.credentials; + } + + /** + * Set the credentials property: Credentials used when importing from a registry uri. + * + * @param credentials the credentials value to set. + * @return the ImportSource object itself. + */ + public ImportSource withCredentials(ImportSourceCredentials credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the sourceImage property: Repository name of the source image. Specify an image by repository + * ('hello-world'). This will use the 'latest' tag. Specify an image by tag ('hello-world:latest'). Specify an image + * by sha256-based manifest digest ('hello-world@sha256:abc123'). + * + * @return the sourceImage value. + */ + public String sourceImage() { + return this.sourceImage; + } + + /** + * Set the sourceImage property: Repository name of the source image. Specify an image by repository + * ('hello-world'). This will use the 'latest' tag. Specify an image by tag ('hello-world:latest'). Specify an image + * by sha256-based manifest digest ('hello-world@sha256:abc123'). + * + * @param sourceImage the sourceImage value to set. + * @return the ImportSource object itself. + */ + public ImportSource withSourceImage(String sourceImage) { + this.sourceImage = sourceImage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (credentials() != null) { + credentials().validate(); + } + if (sourceImage() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sourceImage in model ImportSource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImportSource.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSourceCredentials.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSourceCredentials.java new file mode 100644 index 000000000000..6ee315b1c8c2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ImportSourceCredentials.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ImportSourceCredentials model. */ +@Fluent +public final class ImportSourceCredentials { + /* + * The username to authenticate with the source registry. + */ + @JsonProperty(value = "username") + private String username; + + /* + * The password used to authenticate with the source registry. + */ + @JsonProperty(value = "password", required = true) + private String password; + + /** + * Get the username property: The username to authenticate with the source registry. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username to authenticate with the source registry. + * + * @param username the username value to set. + * @return the ImportSourceCredentials object itself. + */ + public ImportSourceCredentials withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password used to authenticate with the source registry. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password used to authenticate with the source registry. + * + * @param password the password value to set. + * @return the ImportSourceCredentials object itself. + */ + public ImportSourceCredentials withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (password() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property password in model ImportSourceCredentials")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ImportSourceCredentials.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IpRule.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IpRule.java new file mode 100644 index 000000000000..1507d8f1d2bb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/IpRule.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP rule with specific IP or IP range in CIDR format. */ +@Fluent +public final class IpRule { + /* + * The action of IP ACL rule. + */ + @JsonProperty(value = "action") + private Action action; + + /* + * Specifies the IP or IP range in CIDR format. Only IPV4 address is + * allowed. + */ + @JsonProperty(value = "value", required = true) + private String ipAddressOrRange; + + /** + * Get the action property: The action of IP ACL rule. + * + * @return the action value. + */ + public Action action() { + return this.action; + } + + /** + * Set the action property: The action of IP ACL rule. + * + * @param action the action value to set. + * @return the IpRule object itself. + */ + public IpRule withAction(Action action) { + this.action = action; + return this; + } + + /** + * Get the ipAddressOrRange property: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @return the ipAddressOrRange value. + */ + public String ipAddressOrRange() { + return this.ipAddressOrRange; + } + + /** + * Set the ipAddressOrRange property: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @param ipAddressOrRange the ipAddressOrRange value to set. + * @return the IpRule object itself. + */ + public IpRule withIpAddressOrRange(String ipAddressOrRange) { + this.ipAddressOrRange = ipAddressOrRange; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipAddressOrRange() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property ipAddressOrRange in model IpRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpRule.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/KeyVaultProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/KeyVaultProperties.java new file mode 100644 index 000000000000..eebad1bc8652 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/KeyVaultProperties.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The KeyVaultProperties model. */ +@Fluent +public final class KeyVaultProperties { + /* + * Key vault uri to access the encryption key. + */ + @JsonProperty(value = "keyIdentifier") + private String keyIdentifier; + + /* + * The fully qualified key identifier that includes the version of the key + * that is actually used for encryption. + */ + @JsonProperty(value = "versionedKeyIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String versionedKeyIdentifier; + + /* + * The client id of the identity which will be used to access key vault. + */ + @JsonProperty(value = "identity") + private String identity; + + /* + * Auto key rotation status for a CMK enabled registry. + */ + @JsonProperty(value = "keyRotationEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean keyRotationEnabled; + + /* + * Timestamp of the last successful key rotation. + */ + @JsonProperty(value = "lastKeyRotationTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastKeyRotationTimestamp; + + /** + * Get the keyIdentifier property: Key vault uri to access the encryption key. + * + * @return the keyIdentifier value. + */ + public String keyIdentifier() { + return this.keyIdentifier; + } + + /** + * Set the keyIdentifier property: Key vault uri to access the encryption key. + * + * @param keyIdentifier the keyIdentifier value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Get the versionedKeyIdentifier property: The fully qualified key identifier that includes the version of the key + * that is actually used for encryption. + * + * @return the versionedKeyIdentifier value. + */ + public String versionedKeyIdentifier() { + return this.versionedKeyIdentifier; + } + + /** + * Get the identity property: The client id of the identity which will be used to access key vault. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: The client id of the identity which will be used to access key vault. + * + * @param identity the identity value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withIdentity(String identity) { + this.identity = identity; + return this; + } + + /** + * Get the keyRotationEnabled property: Auto key rotation status for a CMK enabled registry. + * + * @return the keyRotationEnabled value. + */ + public Boolean keyRotationEnabled() { + return this.keyRotationEnabled; + } + + /** + * Get the lastKeyRotationTimestamp property: Timestamp of the last successful key rotation. + * + * @return the lastKeyRotationTimestamp value. + */ + public OffsetDateTime lastKeyRotationTimestamp() { + return this.lastKeyRotationTimestamp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LogLevel.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LogLevel.java new file mode 100644 index 000000000000..3087a0153547 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LogLevel.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LogLevel. */ +public final class LogLevel extends ExpandableStringEnum { + /** Static value Debug for LogLevel. */ + public static final LogLevel DEBUG = fromString("Debug"); + + /** Static value Information for LogLevel. */ + public static final LogLevel INFORMATION = fromString("Information"); + + /** Static value Warning for LogLevel. */ + public static final LogLevel WARNING = fromString("Warning"); + + /** Static value Error for LogLevel. */ + public static final LogLevel ERROR = fromString("Error"); + + /** Static value None for LogLevel. */ + public static final LogLevel NONE = fromString("None"); + + /** + * Creates or finds a LogLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding LogLevel. + */ + @JsonCreator + public static LogLevel fromString(String name) { + return fromString(name, LogLevel.class); + } + + /** @return known LogLevel values. */ + public static Collection values() { + return values(LogLevel.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LoggingProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LoggingProperties.java new file mode 100644 index 000000000000..2f3ee5983fe5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LoggingProperties.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The logging properties of the connected registry. */ +@Fluent +public final class LoggingProperties { + /* + * The verbosity of logs persisted on the connected registry. + */ + @JsonProperty(value = "logLevel") + private LogLevel logLevel; + + /* + * Indicates whether audit logs are enabled on the connected registry. + */ + @JsonProperty(value = "auditLogStatus") + private AuditLogStatus auditLogStatus; + + /** + * Get the logLevel property: The verbosity of logs persisted on the connected registry. + * + * @return the logLevel value. + */ + public LogLevel logLevel() { + return this.logLevel; + } + + /** + * Set the logLevel property: The verbosity of logs persisted on the connected registry. + * + * @param logLevel the logLevel value to set. + * @return the LoggingProperties object itself. + */ + public LoggingProperties withLogLevel(LogLevel logLevel) { + this.logLevel = logLevel; + return this; + } + + /** + * Get the auditLogStatus property: Indicates whether audit logs are enabled on the connected registry. + * + * @return the auditLogStatus value. + */ + public AuditLogStatus auditLogStatus() { + return this.auditLogStatus; + } + + /** + * Set the auditLogStatus property: Indicates whether audit logs are enabled on the connected registry. + * + * @param auditLogStatus the auditLogStatus value to set. + * @return the LoggingProperties object itself. + */ + public LoggingProperties withAuditLogStatus(AuditLogStatus auditLogStatus) { + this.auditLogStatus = auditLogStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LoginServerProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LoginServerProperties.java new file mode 100644 index 000000000000..ac46af90ffe9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/LoginServerProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The login server properties of the connected registry. */ +@Immutable +public final class LoginServerProperties { + /* + * The host of the connected registry. Can be FQDN or IP. + */ + @JsonProperty(value = "host", access = JsonProperty.Access.WRITE_ONLY) + private String host; + + /* + * The TLS properties of the connected registry login server. + */ + @JsonProperty(value = "tls", access = JsonProperty.Access.WRITE_ONLY) + private TlsProperties tls; + + /** + * Get the host property: The host of the connected registry. Can be FQDN or IP. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Get the tls property: The TLS properties of the connected registry login server. + * + * @return the tls value. + */ + public TlsProperties tls() { + return this.tls; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tls() != null) { + tls().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleBypassOptions.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleBypassOptions.java new file mode 100644 index 000000000000..321831db4335 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleBypassOptions.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkRuleBypassOptions. */ +public final class NetworkRuleBypassOptions extends ExpandableStringEnum { + /** Static value AzureServices for NetworkRuleBypassOptions. */ + public static final NetworkRuleBypassOptions AZURE_SERVICES = fromString("AzureServices"); + + /** Static value None for NetworkRuleBypassOptions. */ + public static final NetworkRuleBypassOptions NONE = fromString("None"); + + /** + * Creates or finds a NetworkRuleBypassOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkRuleBypassOptions. + */ + @JsonCreator + public static NetworkRuleBypassOptions fromString(String name) { + return fromString(name, NetworkRuleBypassOptions.class); + } + + /** @return known NetworkRuleBypassOptions values. */ + public static Collection values() { + return values(NetworkRuleBypassOptions.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleSet.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleSet.java new file mode 100644 index 000000000000..cca9ce628110 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/NetworkRuleSet.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The network rule set for a container registry. */ +@Fluent +public final class NetworkRuleSet { + /* + * The default action of allow or deny when no other rules match. + */ + @JsonProperty(value = "defaultAction", required = true) + private DefaultAction defaultAction; + + /* + * The IP ACL rules. + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /** + * Get the defaultAction property: The default action of allow or deny when no other rules match. + * + * @return the defaultAction value. + */ + public DefaultAction defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: The default action of allow or deny when no other rules match. + * + * @param defaultAction the defaultAction value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withDefaultAction(DefaultAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Get the ipRules property: The IP ACL rules. + * + * @return the ipRules value. + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set the ipRules property: The IP ACL rules. + * + * @param ipRules the ipRules value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (defaultAction() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property defaultAction in model NetworkRuleSet")); + } + if (ipRules() != null) { + ipRules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkRuleSet.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationDefinition.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationDefinition.java new file mode 100644 index 000000000000..e25591c7c71f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationDefinition.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.OperationDefinitionInner; + +/** An immutable client-side representation of OperationDefinition. */ +public interface OperationDefinition { + /** + * Gets the origin property: The origin information of the container registry operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The display information for the container registry operation. + * + * @return the display value. + */ + OperationDisplayDefinition display(); + + /** + * Gets the isDataAction property: This property indicates if the operation is an action or a data action ref: + * https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the serviceSpecification property: The definition of Azure Monitoring service. + * + * @return the serviceSpecification value. + */ + OperationServiceSpecificationDefinition serviceSpecification(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.OperationDefinitionInner + * object. + * + * @return the inner object. + */ + OperationDefinitionInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationDisplayDefinition.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationDisplayDefinition.java new file mode 100644 index 000000000000..1b95e65f9c4e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationDisplayDefinition.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The display information for a container registry operation. */ +@Fluent +public final class OperationDisplayDefinition { + /* + * The resource provider name: Microsoft.ContainerRegistry. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * The resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * The operation that users can perform. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * The description for the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: The resource provider name: Microsoft.ContainerRegistry. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The resource provider name: Microsoft.ContainerRegistry. + * + * @param provider the provider value to set. + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: The resource on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The resource on which the operation is performed. + * + * @param resource the resource value to set. + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: The operation that users can perform. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The operation that users can perform. + * + * @param operation the operation value to set. + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: The description for the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description for the operation. + * + * @param description the description value to set. + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationListResult.java new file mode 100644 index 000000000000..5619244d5630 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationListResult.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.OperationDefinitionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list container registry operations. */ +@Fluent +public final class OperationListResult { + /* + * The list of container registry operations. Since this list may be + * incomplete, the nextLink field should be used to request the next list + * of operations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of container registry + * operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of container registry operations. Since this list may be incomplete, the + * nextLink field should be used to request the next list of operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of container registry operations. Since this list may be incomplete, the + * nextLink field should be used to request the next list of operations. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of container registry operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of container registry operations. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationLogSpecificationDefinition.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationLogSpecificationDefinition.java new file mode 100644 index 000000000000..200f81ed5c05 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationLogSpecificationDefinition.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The definition of Azure Monitoring log. */ +@Fluent +public final class OperationLogSpecificationDefinition { + /* + * Log name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Log display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Log blob duration. + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** + * Get the name property: Log name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Log name. + * + * @param name the name value to set. + * @return the OperationLogSpecificationDefinition object itself. + */ + public OperationLogSpecificationDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Log display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Log display name. + * + * @param displayName the displayName value to set. + * @return the OperationLogSpecificationDefinition object itself. + */ + public OperationLogSpecificationDefinition withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the blobDuration property: Log blob duration. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: Log blob duration. + * + * @param blobDuration the blobDuration value to set. + * @return the OperationLogSpecificationDefinition object itself. + */ + public OperationLogSpecificationDefinition withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationMetricSpecificationDefinition.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationMetricSpecificationDefinition.java new file mode 100644 index 000000000000..c9e7a17686e2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationMetricSpecificationDefinition.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The definition of Azure Monitoring metric. */ +@Fluent +public final class OperationMetricSpecificationDefinition { + /* + * Metric name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Metric display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Metric description. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Metric unit. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * Metric aggregation type. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * Internal metric name. + */ + @JsonProperty(value = "internalMetricName") + private String internalMetricName; + + /** + * Get the name property: Metric name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Metric name. + * + * @param name the name value to set. + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Metric display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Metric display name. + * + * @param displayName the displayName value to set. + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: Metric description. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Metric description. + * + * @param displayDescription the displayDescription value to set. + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: Metric unit. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Metric unit. + * + * @param unit the unit value to set. + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the aggregationType property: Metric aggregation type. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: Metric aggregation type. + * + * @param aggregationType the aggregationType value to set. + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the internalMetricName property: Internal metric name. + * + * @return the internalMetricName value. + */ + public String internalMetricName() { + return this.internalMetricName; + } + + /** + * Set the internalMetricName property: Internal metric name. + * + * @param internalMetricName the internalMetricName value to set. + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withInternalMetricName(String internalMetricName) { + this.internalMetricName = internalMetricName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationServiceSpecificationDefinition.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationServiceSpecificationDefinition.java new file mode 100644 index 000000000000..33b846d8e5f6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/OperationServiceSpecificationDefinition.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The definition of Azure Monitoring list. */ +@Fluent +public final class OperationServiceSpecificationDefinition { + /* + * A list of Azure Monitoring metrics definition. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /* + * A list of Azure Monitoring log definitions. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Get the metricSpecifications property: A list of Azure Monitoring metrics definition. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: A list of Azure Monitoring metrics definition. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the OperationServiceSpecificationDefinition object itself. + */ + public OperationServiceSpecificationDefinition withMetricSpecifications( + List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Get the logSpecifications property: A list of Azure Monitoring log definitions. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: A list of Azure Monitoring log definitions. + * + * @param logSpecifications the logSpecifications value to set. + * @return the OperationServiceSpecificationDefinition object itself. + */ + public OperationServiceSpecificationDefinition withLogSpecifications( + List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Operations.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Operations.java new file mode 100644 index 000000000000..8f2a986fd1cd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registry operations as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ParentProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ParentProperties.java new file mode 100644 index 000000000000..9c93ae840fd9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ParentProperties.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the connected registry parent. */ +@Fluent +public final class ParentProperties { + /* + * The resource ID of the parent to which the connected registry will be + * associated. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The sync properties of the connected registry with its parent. + */ + @JsonProperty(value = "syncProperties", required = true) + private SyncProperties syncProperties; + + /** + * Get the id property: The resource ID of the parent to which the connected registry will be associated. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The resource ID of the parent to which the connected registry will be associated. + * + * @param id the id value to set. + * @return the ParentProperties object itself. + */ + public ParentProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the syncProperties property: The sync properties of the connected registry with its parent. + * + * @return the syncProperties value. + */ + public SyncProperties syncProperties() { + return this.syncProperties; + } + + /** + * Set the syncProperties property: The sync properties of the connected registry with its parent. + * + * @param syncProperties the syncProperties value to set. + * @return the ParentProperties object itself. + */ + public ParentProperties withSyncProperties(SyncProperties syncProperties) { + this.syncProperties = syncProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (syncProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property syncProperties in model ParentProperties")); + } else { + syncProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ParentProperties.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PasswordName.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PasswordName.java new file mode 100644 index 000000000000..e282c7701e0b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PasswordName.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for PasswordName. */ +public enum PasswordName { + /** Enum value password. */ + PASSWORD("password"), + + /** Enum value password2. */ + PASSWORD2("password2"); + + /** The actual serialized value for a PasswordName instance. */ + private final String value; + + PasswordName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PasswordName instance. + * + * @param value the serialized value to parse. + * @return the parsed PasswordName object, or null if unable to parse. + */ + @JsonCreator + public static PasswordName fromString(String value) { + PasswordName[] items = PasswordName.values(); + for (PasswordName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineOptions.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineOptions.java new file mode 100644 index 000000000000..41f117426ee2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineOptions.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PipelineOptions. */ +public final class PipelineOptions extends ExpandableStringEnum { + /** Static value OverwriteTags for PipelineOptions. */ + public static final PipelineOptions OVERWRITE_TAGS = fromString("OverwriteTags"); + + /** Static value OverwriteBlobs for PipelineOptions. */ + public static final PipelineOptions OVERWRITE_BLOBS = fromString("OverwriteBlobs"); + + /** Static value DeleteSourceBlobOnSuccess for PipelineOptions. */ + public static final PipelineOptions DELETE_SOURCE_BLOB_ON_SUCCESS = fromString("DeleteSourceBlobOnSuccess"); + + /** Static value ContinueOnErrors for PipelineOptions. */ + public static final PipelineOptions CONTINUE_ON_ERRORS = fromString("ContinueOnErrors"); + + /** + * Creates or finds a PipelineOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding PipelineOptions. + */ + @JsonCreator + public static PipelineOptions fromString(String name) { + return fromString(name, PipelineOptions.class); + } + + /** @return known PipelineOptions values. */ + public static Collection values() { + return values(PipelineOptions.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRun.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRun.java new file mode 100644 index 000000000000..54d32721a880 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRun.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PipelineRunInner; + +/** An immutable client-side representation of PipelineRun. */ +public interface PipelineRun { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioning state of a pipeline run. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the request property: The request parameters for a pipeline run. + * + * @return the request value. + */ + PipelineRunRequest request(); + + /** + * Gets the response property: The response of a pipeline run. + * + * @return the response value. + */ + PipelineRunResponse response(); + + /** + * Gets the forceUpdateTag property: How the pipeline run should be forced to recreate even if the pipeline run + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + String forceUpdateTag(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.PipelineRunInner object. + * + * @return the inner object. + */ + PipelineRunInner innerModel(); + + /** The entirety of the PipelineRun definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PipelineRun definition stages. */ + interface DefinitionStages { + /** The first stage of the PipelineRun definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PipelineRun definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the PipelineRun definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithRequest, DefinitionStages.WithForceUpdateTag { + /** + * Executes the create request. + * + * @return the created resource. + */ + PipelineRun create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PipelineRun create(Context context); + } + /** The stage of the PipelineRun definition allowing to specify request. */ + interface WithRequest { + /** + * Specifies the request property: The request parameters for a pipeline run.. + * + * @param request The request parameters for a pipeline run. + * @return the next definition stage. + */ + WithCreate withRequest(PipelineRunRequest request); + } + /** The stage of the PipelineRun definition allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: How the pipeline run should be forced to recreate even if the + * pipeline run configuration has not changed.. + * + * @param forceUpdateTag How the pipeline run should be forced to recreate even if the pipeline run + * configuration has not changed. + * @return the next definition stage. + */ + WithCreate withForceUpdateTag(String forceUpdateTag); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PipelineRun refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PipelineRun refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunListResult.java new file mode 100644 index 000000000000..93cc4dac8b49 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunListResult.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PipelineRunInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list pipeline runs for a container registry. */ +@Fluent +public final class PipelineRunListResult { + /* + * The list of pipeline runs. Since this list may be incomplete, the + * nextLink field should be used to request the next list of pipeline runs. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of pipeline runs. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of pipeline runs. Since this list may be incomplete, the nextLink field should + * be used to request the next list of pipeline runs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of pipeline runs. Since this list may be incomplete, the nextLink field should + * be used to request the next list of pipeline runs. + * + * @param value the value value to set. + * @return the PipelineRunListResult object itself. + */ + public PipelineRunListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of pipeline runs. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of pipeline runs. + * + * @param nextLink the nextLink value to set. + * @return the PipelineRunListResult object itself. + */ + public PipelineRunListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunRequest.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunRequest.java new file mode 100644 index 000000000000..a9b08ec89386 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunRequest.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The request properties provided for a pipeline run. */ +@Fluent +public final class PipelineRunRequest { + /* + * The resource ID of the pipeline to run. + */ + @JsonProperty(value = "pipelineResourceId") + private String pipelineResourceId; + + /* + * List of source artifacts to be transferred by the pipeline. + * Specify an image by repository ('hello-world'). This will use the + * 'latest' tag. + * Specify an image by tag ('hello-world:latest'). + * Specify an image by sha256-based manifest digest + * ('hello-world@sha256:abc123'). + */ + @JsonProperty(value = "artifacts") + private List artifacts; + + /* + * The source properties of the pipeline run. + */ + @JsonProperty(value = "source") + private PipelineRunSourceProperties source; + + /* + * The target properties of the pipeline run. + */ + @JsonProperty(value = "target") + private PipelineRunTargetProperties target; + + /* + * The digest of the tar used to transfer the artifacts. + */ + @JsonProperty(value = "catalogDigest") + private String catalogDigest; + + /** + * Get the pipelineResourceId property: The resource ID of the pipeline to run. + * + * @return the pipelineResourceId value. + */ + public String pipelineResourceId() { + return this.pipelineResourceId; + } + + /** + * Set the pipelineResourceId property: The resource ID of the pipeline to run. + * + * @param pipelineResourceId the pipelineResourceId value to set. + * @return the PipelineRunRequest object itself. + */ + public PipelineRunRequest withPipelineResourceId(String pipelineResourceId) { + this.pipelineResourceId = pipelineResourceId; + return this; + } + + /** + * Get the artifacts property: List of source artifacts to be transferred by the pipeline. Specify an image by + * repository ('hello-world'). This will use the 'latest' tag. Specify an image by tag ('hello-world:latest'). + * Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). + * + * @return the artifacts value. + */ + public List artifacts() { + return this.artifacts; + } + + /** + * Set the artifacts property: List of source artifacts to be transferred by the pipeline. Specify an image by + * repository ('hello-world'). This will use the 'latest' tag. Specify an image by tag ('hello-world:latest'). + * Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). + * + * @param artifacts the artifacts value to set. + * @return the PipelineRunRequest object itself. + */ + public PipelineRunRequest withArtifacts(List artifacts) { + this.artifacts = artifacts; + return this; + } + + /** + * Get the source property: The source properties of the pipeline run. + * + * @return the source value. + */ + public PipelineRunSourceProperties source() { + return this.source; + } + + /** + * Set the source property: The source properties of the pipeline run. + * + * @param source the source value to set. + * @return the PipelineRunRequest object itself. + */ + public PipelineRunRequest withSource(PipelineRunSourceProperties source) { + this.source = source; + return this; + } + + /** + * Get the target property: The target properties of the pipeline run. + * + * @return the target value. + */ + public PipelineRunTargetProperties target() { + return this.target; + } + + /** + * Set the target property: The target properties of the pipeline run. + * + * @param target the target value to set. + * @return the PipelineRunRequest object itself. + */ + public PipelineRunRequest withTarget(PipelineRunTargetProperties target) { + this.target = target; + return this; + } + + /** + * Get the catalogDigest property: The digest of the tar used to transfer the artifacts. + * + * @return the catalogDigest value. + */ + public String catalogDigest() { + return this.catalogDigest; + } + + /** + * Set the catalogDigest property: The digest of the tar used to transfer the artifacts. + * + * @param catalogDigest the catalogDigest value to set. + * @return the PipelineRunRequest object itself. + */ + public PipelineRunRequest withCatalogDigest(String catalogDigest) { + this.catalogDigest = catalogDigest; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (target() != null) { + target().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunResponse.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunResponse.java new file mode 100644 index 000000000000..b053750fbe27 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunResponse.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The response properties returned for a pipeline run. */ +@Fluent +public final class PipelineRunResponse { + /* + * The current status of the pipeline run. + */ + @JsonProperty(value = "status") + private String status; + + /* + * The artifacts imported in the pipeline run. + */ + @JsonProperty(value = "importedArtifacts") + private List importedArtifacts; + + /* + * The current progress of the copy operation. + */ + @JsonProperty(value = "progress") + private ProgressProperties progress; + + /* + * The time the pipeline run started. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The time the pipeline run finished. + */ + @JsonProperty(value = "finishTime") + private OffsetDateTime finishTime; + + /* + * The source of the pipeline run. + */ + @JsonProperty(value = "source") + private ImportPipelineSourceProperties source; + + /* + * The target of the pipeline run. + */ + @JsonProperty(value = "target") + private ExportPipelineTargetProperties target; + + /* + * The digest of the tar used to transfer the artifacts. + */ + @JsonProperty(value = "catalogDigest") + private String catalogDigest; + + /* + * The trigger that caused the pipeline run. + */ + @JsonProperty(value = "trigger") + private PipelineTriggerDescriptor trigger; + + /* + * The detailed error message for the pipeline run in the case of failure. + */ + @JsonProperty(value = "pipelineRunErrorMessage") + private String pipelineRunErrorMessage; + + /** + * Get the status property: The current status of the pipeline run. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The current status of the pipeline run. + * + * @param status the status value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the importedArtifacts property: The artifacts imported in the pipeline run. + * + * @return the importedArtifacts value. + */ + public List importedArtifacts() { + return this.importedArtifacts; + } + + /** + * Set the importedArtifacts property: The artifacts imported in the pipeline run. + * + * @param importedArtifacts the importedArtifacts value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withImportedArtifacts(List importedArtifacts) { + this.importedArtifacts = importedArtifacts; + return this; + } + + /** + * Get the progress property: The current progress of the copy operation. + * + * @return the progress value. + */ + public ProgressProperties progress() { + return this.progress; + } + + /** + * Set the progress property: The current progress of the copy operation. + * + * @param progress the progress value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withProgress(ProgressProperties progress) { + this.progress = progress; + return this; + } + + /** + * Get the startTime property: The time the pipeline run started. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The time the pipeline run started. + * + * @param startTime the startTime value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the finishTime property: The time the pipeline run finished. + * + * @return the finishTime value. + */ + public OffsetDateTime finishTime() { + return this.finishTime; + } + + /** + * Set the finishTime property: The time the pipeline run finished. + * + * @param finishTime the finishTime value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withFinishTime(OffsetDateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the source property: The source of the pipeline run. + * + * @return the source value. + */ + public ImportPipelineSourceProperties source() { + return this.source; + } + + /** + * Set the source property: The source of the pipeline run. + * + * @param source the source value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withSource(ImportPipelineSourceProperties source) { + this.source = source; + return this; + } + + /** + * Get the target property: The target of the pipeline run. + * + * @return the target value. + */ + public ExportPipelineTargetProperties target() { + return this.target; + } + + /** + * Set the target property: The target of the pipeline run. + * + * @param target the target value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withTarget(ExportPipelineTargetProperties target) { + this.target = target; + return this; + } + + /** + * Get the catalogDigest property: The digest of the tar used to transfer the artifacts. + * + * @return the catalogDigest value. + */ + public String catalogDigest() { + return this.catalogDigest; + } + + /** + * Set the catalogDigest property: The digest of the tar used to transfer the artifacts. + * + * @param catalogDigest the catalogDigest value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withCatalogDigest(String catalogDigest) { + this.catalogDigest = catalogDigest; + return this; + } + + /** + * Get the trigger property: The trigger that caused the pipeline run. + * + * @return the trigger value. + */ + public PipelineTriggerDescriptor trigger() { + return this.trigger; + } + + /** + * Set the trigger property: The trigger that caused the pipeline run. + * + * @param trigger the trigger value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withTrigger(PipelineTriggerDescriptor trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the pipelineRunErrorMessage property: The detailed error message for the pipeline run in the case of failure. + * + * @return the pipelineRunErrorMessage value. + */ + public String pipelineRunErrorMessage() { + return this.pipelineRunErrorMessage; + } + + /** + * Set the pipelineRunErrorMessage property: The detailed error message for the pipeline run in the case of failure. + * + * @param pipelineRunErrorMessage the pipelineRunErrorMessage value to set. + * @return the PipelineRunResponse object itself. + */ + public PipelineRunResponse withPipelineRunErrorMessage(String pipelineRunErrorMessage) { + this.pipelineRunErrorMessage = pipelineRunErrorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (progress() != null) { + progress().validate(); + } + if (source() != null) { + source().validate(); + } + if (target() != null) { + target().validate(); + } + if (trigger() != null) { + trigger().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunSourceProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunSourceProperties.java new file mode 100644 index 000000000000..93bd3ef36da6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunSourceProperties.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PipelineRunSourceProperties model. */ +@Fluent +public final class PipelineRunSourceProperties { + /* + * The type of the source. + */ + @JsonProperty(value = "type") + private PipelineRunSourceType type; + + /* + * The name of the source. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the type property: The type of the source. + * + * @return the type value. + */ + public PipelineRunSourceType type() { + return this.type; + } + + /** + * Set the type property: The type of the source. + * + * @param type the type value to set. + * @return the PipelineRunSourceProperties object itself. + */ + public PipelineRunSourceProperties withType(PipelineRunSourceType type) { + this.type = type; + return this; + } + + /** + * Get the name property: The name of the source. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the source. + * + * @param name the name value to set. + * @return the PipelineRunSourceProperties object itself. + */ + public PipelineRunSourceProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunSourceType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunSourceType.java new file mode 100644 index 000000000000..26a27142b404 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunSourceType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PipelineRunSourceType. */ +public final class PipelineRunSourceType extends ExpandableStringEnum { + /** Static value AzureStorageBlob for PipelineRunSourceType. */ + public static final PipelineRunSourceType AZURE_STORAGE_BLOB = fromString("AzureStorageBlob"); + + /** + * Creates or finds a PipelineRunSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PipelineRunSourceType. + */ + @JsonCreator + public static PipelineRunSourceType fromString(String name) { + return fromString(name, PipelineRunSourceType.class); + } + + /** @return known PipelineRunSourceType values. */ + public static Collection values() { + return values(PipelineRunSourceType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunTargetProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunTargetProperties.java new file mode 100644 index 000000000000..2fa96fd89aae --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunTargetProperties.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PipelineRunTargetProperties model. */ +@Fluent +public final class PipelineRunTargetProperties { + /* + * The type of the target. + */ + @JsonProperty(value = "type") + private PipelineRunTargetType type; + + /* + * The name of the target. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the type property: The type of the target. + * + * @return the type value. + */ + public PipelineRunTargetType type() { + return this.type; + } + + /** + * Set the type property: The type of the target. + * + * @param type the type value to set. + * @return the PipelineRunTargetProperties object itself. + */ + public PipelineRunTargetProperties withType(PipelineRunTargetType type) { + this.type = type; + return this; + } + + /** + * Get the name property: The name of the target. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the target. + * + * @param name the name value to set. + * @return the PipelineRunTargetProperties object itself. + */ + public PipelineRunTargetProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunTargetType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunTargetType.java new file mode 100644 index 000000000000..2f3c05c34226 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRunTargetType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PipelineRunTargetType. */ +public final class PipelineRunTargetType extends ExpandableStringEnum { + /** Static value AzureStorageBlob for PipelineRunTargetType. */ + public static final PipelineRunTargetType AZURE_STORAGE_BLOB = fromString("AzureStorageBlob"); + + /** + * Creates or finds a PipelineRunTargetType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PipelineRunTargetType. + */ + @JsonCreator + public static PipelineRunTargetType fromString(String name) { + return fromString(name, PipelineRunTargetType.class); + } + + /** @return known PipelineRunTargetType values. */ + public static Collection values() { + return values(PipelineRunTargetType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRuns.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRuns.java new file mode 100644 index 000000000000..f1ed77330a07 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineRuns.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PipelineRuns. */ +public interface PipelineRuns { + /** + * Lists all the pipeline runs for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the pipeline runs for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list pipeline runs for a container registry as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run. + */ + PipelineRun get(String resourceGroupName, String registryName, String pipelineRunName); + + /** + * Gets the detailed information for a given pipeline run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String pipelineRunName, Context context); + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String pipelineRunName); + + /** + * Deletes a pipeline run from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param pipelineRunName The name of the pipeline run. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String pipelineRunName, Context context); + + /** + * Gets the detailed information for a given pipeline run. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run along with {@link Response}. + */ + PipelineRun getById(String id); + + /** + * Gets the detailed information for a given pipeline run. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given pipeline run along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a pipeline run from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a pipeline run from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PipelineRun resource. + * + * @param name resource name. + * @return the first stage of the new PipelineRun definition. + */ + PipelineRun.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceTriggerDescriptor.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceTriggerDescriptor.java new file mode 100644 index 000000000000..04b59c1e38c7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceTriggerDescriptor.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The PipelineSourceTriggerDescriptor model. */ +@Fluent +public final class PipelineSourceTriggerDescriptor { + /* + * The timestamp when the source update happened. + */ + @JsonProperty(value = "timestamp") + private OffsetDateTime timestamp; + + /** + * Get the timestamp property: The timestamp when the source update happened. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp property: The timestamp when the source update happened. + * + * @param timestamp the timestamp value to set. + * @return the PipelineSourceTriggerDescriptor object itself. + */ + public PipelineSourceTriggerDescriptor withTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceTriggerProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceTriggerProperties.java new file mode 100644 index 000000000000..980a9f815482 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceTriggerProperties.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PipelineSourceTriggerProperties model. */ +@Fluent +public final class PipelineSourceTriggerProperties { + /* + * The current status of the source trigger. + */ + @JsonProperty(value = "status", required = true) + private TriggerStatus status; + + /** + * Get the status property: The current status of the source trigger. + * + * @return the status value. + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the status property: The current status of the source trigger. + * + * @param status the status value to set. + * @return the PipelineSourceTriggerProperties object itself. + */ + public PipelineSourceTriggerProperties withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property status in model PipelineSourceTriggerProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PipelineSourceTriggerProperties.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceType.java new file mode 100644 index 000000000000..bebd638526ce --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineSourceType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PipelineSourceType. */ +public final class PipelineSourceType extends ExpandableStringEnum { + /** Static value AzureStorageBlobContainer for PipelineSourceType. */ + public static final PipelineSourceType AZURE_STORAGE_BLOB_CONTAINER = fromString("AzureStorageBlobContainer"); + + /** + * Creates or finds a PipelineSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PipelineSourceType. + */ + @JsonCreator + public static PipelineSourceType fromString(String name) { + return fromString(name, PipelineSourceType.class); + } + + /** @return known PipelineSourceType values. */ + public static Collection values() { + return values(PipelineSourceType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineTriggerDescriptor.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineTriggerDescriptor.java new file mode 100644 index 000000000000..ac9bd49fd083 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineTriggerDescriptor.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PipelineTriggerDescriptor model. */ +@Fluent +public final class PipelineTriggerDescriptor { + /* + * The source trigger that caused the pipeline run. + */ + @JsonProperty(value = "sourceTrigger") + private PipelineSourceTriggerDescriptor sourceTrigger; + + /** + * Get the sourceTrigger property: The source trigger that caused the pipeline run. + * + * @return the sourceTrigger value. + */ + public PipelineSourceTriggerDescriptor sourceTrigger() { + return this.sourceTrigger; + } + + /** + * Set the sourceTrigger property: The source trigger that caused the pipeline run. + * + * @param sourceTrigger the sourceTrigger value to set. + * @return the PipelineTriggerDescriptor object itself. + */ + public PipelineTriggerDescriptor withSourceTrigger(PipelineSourceTriggerDescriptor sourceTrigger) { + this.sourceTrigger = sourceTrigger; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceTrigger() != null) { + sourceTrigger().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineTriggerProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineTriggerProperties.java new file mode 100644 index 000000000000..0bbb66063332 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PipelineTriggerProperties.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PipelineTriggerProperties model. */ +@Fluent +public final class PipelineTriggerProperties { + /* + * The source trigger properties of the pipeline. + */ + @JsonProperty(value = "sourceTrigger") + private PipelineSourceTriggerProperties sourceTrigger; + + /** + * Get the sourceTrigger property: The source trigger properties of the pipeline. + * + * @return the sourceTrigger value. + */ + public PipelineSourceTriggerProperties sourceTrigger() { + return this.sourceTrigger; + } + + /** + * Set the sourceTrigger property: The source trigger properties of the pipeline. + * + * @param sourceTrigger the sourceTrigger value to set. + * @return the PipelineTriggerProperties object itself. + */ + public PipelineTriggerProperties withSourceTrigger(PipelineSourceTriggerProperties sourceTrigger) { + this.sourceTrigger = sourceTrigger; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceTrigger() != null) { + sourceTrigger().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Policies.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Policies.java new file mode 100644 index 000000000000..af27433dd273 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Policies.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The policies for a container registry. */ +@Fluent +public final class Policies { + /* + * The quarantine policy for a container registry. + */ + @JsonProperty(value = "quarantinePolicy") + private QuarantinePolicy quarantinePolicy; + + /* + * The content trust policy for a container registry. + */ + @JsonProperty(value = "trustPolicy") + private TrustPolicy trustPolicy; + + /* + * The retention policy for a container registry. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /* + * The export policy for a container registry. + */ + @JsonProperty(value = "exportPolicy") + private ExportPolicy exportPolicy; + + /* + * The policy for using ARM audience token for a container registry. + */ + @JsonProperty(value = "azureADAuthenticationAsArmPolicy") + private AzureADAuthenticationAsArmPolicy azureADAuthenticationAsArmPolicy; + + /* + * The soft delete policy for a container registry. + */ + @JsonProperty(value = "softDeletePolicy") + private SoftDeletePolicy softDeletePolicy; + + /** + * Get the quarantinePolicy property: The quarantine policy for a container registry. + * + * @return the quarantinePolicy value. + */ + public QuarantinePolicy quarantinePolicy() { + return this.quarantinePolicy; + } + + /** + * Set the quarantinePolicy property: The quarantine policy for a container registry. + * + * @param quarantinePolicy the quarantinePolicy value to set. + * @return the Policies object itself. + */ + public Policies withQuarantinePolicy(QuarantinePolicy quarantinePolicy) { + this.quarantinePolicy = quarantinePolicy; + return this; + } + + /** + * Get the trustPolicy property: The content trust policy for a container registry. + * + * @return the trustPolicy value. + */ + public TrustPolicy trustPolicy() { + return this.trustPolicy; + } + + /** + * Set the trustPolicy property: The content trust policy for a container registry. + * + * @param trustPolicy the trustPolicy value to set. + * @return the Policies object itself. + */ + public Policies withTrustPolicy(TrustPolicy trustPolicy) { + this.trustPolicy = trustPolicy; + return this; + } + + /** + * Get the retentionPolicy property: The retention policy for a container registry. + * + * @return the retentionPolicy value. + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retentionPolicy property: The retention policy for a container registry. + * + * @param retentionPolicy the retentionPolicy value to set. + * @return the Policies object itself. + */ + public Policies withRetentionPolicy(RetentionPolicy retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + + /** + * Get the exportPolicy property: The export policy for a container registry. + * + * @return the exportPolicy value. + */ + public ExportPolicy exportPolicy() { + return this.exportPolicy; + } + + /** + * Set the exportPolicy property: The export policy for a container registry. + * + * @param exportPolicy the exportPolicy value to set. + * @return the Policies object itself. + */ + public Policies withExportPolicy(ExportPolicy exportPolicy) { + this.exportPolicy = exportPolicy; + return this; + } + + /** + * Get the azureADAuthenticationAsArmPolicy property: The policy for using ARM audience token for a container + * registry. + * + * @return the azureADAuthenticationAsArmPolicy value. + */ + public AzureADAuthenticationAsArmPolicy azureADAuthenticationAsArmPolicy() { + return this.azureADAuthenticationAsArmPolicy; + } + + /** + * Set the azureADAuthenticationAsArmPolicy property: The policy for using ARM audience token for a container + * registry. + * + * @param azureADAuthenticationAsArmPolicy the azureADAuthenticationAsArmPolicy value to set. + * @return the Policies object itself. + */ + public Policies withAzureADAuthenticationAsArmPolicy( + AzureADAuthenticationAsArmPolicy azureADAuthenticationAsArmPolicy) { + this.azureADAuthenticationAsArmPolicy = azureADAuthenticationAsArmPolicy; + return this; + } + + /** + * Get the softDeletePolicy property: The soft delete policy for a container registry. + * + * @return the softDeletePolicy value. + */ + public SoftDeletePolicy softDeletePolicy() { + return this.softDeletePolicy; + } + + /** + * Set the softDeletePolicy property: The soft delete policy for a container registry. + * + * @param softDeletePolicy the softDeletePolicy value to set. + * @return the Policies object itself. + */ + public Policies withSoftDeletePolicy(SoftDeletePolicy softDeletePolicy) { + this.softDeletePolicy = softDeletePolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (quarantinePolicy() != null) { + quarantinePolicy().validate(); + } + if (trustPolicy() != null) { + trustPolicy().validate(); + } + if (retentionPolicy() != null) { + retentionPolicy().validate(); + } + if (exportPolicy() != null) { + exportPolicy().validate(); + } + if (azureADAuthenticationAsArmPolicy() != null) { + azureADAuthenticationAsArmPolicy().validate(); + } + if (softDeletePolicy() != null) { + softDeletePolicy().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PolicyStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PolicyStatus.java new file mode 100644 index 000000000000..42a918cb8ff1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PolicyStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PolicyStatus. */ +public final class PolicyStatus extends ExpandableStringEnum { + /** Static value enabled for PolicyStatus. */ + public static final PolicyStatus ENABLED = fromString("enabled"); + + /** Static value disabled for PolicyStatus. */ + public static final PolicyStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a PolicyStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PolicyStatus. + */ + @JsonCreator + public static PolicyStatus fromString(String name) { + return fromString(name, PolicyStatus.class); + } + + /** @return known PolicyStatus values. */ + public static Collection values() { + return values(PolicyStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpoint.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpoint.java new file mode 100644 index 000000000000..5961a160ff4e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpoint.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint resource. */ +@Fluent +public final class PrivateEndpoint { + /* + * This is private endpoint resource created with Microsoft.Network + * resource provider. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: This is private endpoint resource created with Microsoft.Network resource provider. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: This is private endpoint resource created with Microsoft.Network resource provider. + * + * @param id the id value to set. + * @return the PrivateEndpoint object itself. + */ + public PrivateEndpoint withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnection.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnection.java new file mode 100644 index 000000000000..59cfb48cead8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the privateEndpoint property: The resource of private endpoint. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of private endpoint connection resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner + * object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** The entirety of the PrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PrivateEndpointConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpointConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private endpoint.. + * + * @param privateEndpoint The resource of private endpoint. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + /** + * Begins update for the PrivateEndpointConnection resource. + * + * @return the stage of resource update. + */ + PrivateEndpointConnection.Update update(); + + /** The template for PrivateEndpointConnection update. */ + interface Update extends UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateEndpointConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateEndpointConnection apply(Context context); + } + /** The PrivateEndpointConnection update stages. */ + interface UpdateStages { + /** The stage of the PrivateEndpointConnection update allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private endpoint.. + * + * @param privateEndpoint The resource of private endpoint. + * @return the next definition stage. + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** The stage of the PrivateEndpointConnection update allowing to specify privateLinkServiceConnectionState. */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + Update withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnectionListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 000000000000..cf12eccd7868 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list private endpoint connections for a container registry. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + /* + * The list of private endpoint connections. Since this list may be + * incomplete, the nextLink field should be used to request the next list + * of private endpoint connections. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of private endpoint + * connections. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of private endpoint connections. Since this list may be incomplete, the nextLink + * field should be used to request the next list of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of private endpoint connections. Since this list may be incomplete, the nextLink + * field should be used to request the next list of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of private endpoint connections. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of private endpoint connections. + * + * @param nextLink the nextLink value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnections.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnections.java new file mode 100644 index 000000000000..1b644491ca4a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateEndpointConnections.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * List all private endpoint connections in a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private endpoint connections for a container registry as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry. + */ + PrivateEndpointConnection get(String resourceGroupName, String registryName, String privateEndpointConnectionName); + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry along with {@link + * Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String privateEndpointConnectionName, Context context); + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry along with {@link + * Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * Get the specified private endpoint connection associated with the container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the container registry along with {@link + * Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified private endpoint connection associated with the container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkResource.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkResource.java new file mode 100644 index 000000000000..654c38022a67 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkResource.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResource. */ +public interface PrivateLinkResource { + /** + * Gets the type property: The resource type is private link resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the id property: The resource ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateLinkResourceInner + * object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkResourceListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkResourceListResult.java new file mode 100644 index 000000000000..4dd0c912da25 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkResourceListResult.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.PrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list private link resources for a container registry. */ +@Fluent +public final class PrivateLinkResourceListResult { + /* + * The list of private link resources. Since this list may be incomplete, + * the nextLink field should be used to request the next list of private + * link resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of private link + * resources. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of private link resources. Since this list may be incomplete, the nextLink field + * should be used to request the next list of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of private link resources. Since this list may be incomplete, the nextLink field + * should be used to request the next list of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResult object itself. + */ + public PrivateLinkResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of private link resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of private link resources. + * + * @param nextLink the nextLink value to set. + * @return the PrivateLinkResourceListResult object itself. + */ + public PrivateLinkResourceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkServiceConnectionState.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..b86aca0d6fae --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The state of a private link service connection. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + /* + * The private link service connection status. + */ + @JsonProperty(value = "status") + private ConnectionStatus status; + + /* + * The description for connection status. For example if connection is + * rejected it can indicate reason for rejection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any + * updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private ActionsRequired actionsRequired; + + /** + * Get the status property: The private link service connection status. + * + * @return the status value. + */ + public ConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: The private link service connection status. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(ConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The description for connection status. For example if connection is rejected it can + * indicate reason for rejection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description for connection status. For example if connection is rejected it can + * indicate reason for rejection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public ActionsRequired actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(ActionsRequired actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ProgressProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ProgressProperties.java new file mode 100644 index 000000000000..8fb50cce22c1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ProgressProperties.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ProgressProperties model. */ +@Fluent +public final class ProgressProperties { + /* + * The percentage complete of the copy operation. + */ + @JsonProperty(value = "percentage") + private String percentage; + + /** + * Get the percentage property: The percentage complete of the copy operation. + * + * @return the percentage value. + */ + public String percentage() { + return this.percentage; + } + + /** + * Set the percentage property: The percentage complete of the copy operation. + * + * @param percentage the percentage value to set. + * @return the ProgressProperties object itself. + */ + public ProgressProperties withPercentage(String percentage) { + this.percentage = percentage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ProvisioningState.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ProvisioningState.java new file mode 100644 index 000000000000..ca319030c599 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ProvisioningState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PublicNetworkAccess.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PublicNetworkAccess.java new file mode 100644 index 000000000000..09242c9e0083 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/PublicNetworkAccess.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicNetworkAccess. */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** @return known PublicNetworkAccess values. */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/QuarantinePolicy.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/QuarantinePolicy.java new file mode 100644 index 000000000000..15c770430677 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/QuarantinePolicy.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The quarantine policy for a container registry. */ +@Fluent +public final class QuarantinePolicy { + /* + * The value that indicates whether the policy is enabled or not. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /** + * Get the status property: The value that indicates whether the policy is enabled or not. + * + * @return the status value. + */ + public PolicyStatus status() { + return this.status; + } + + /** + * Set the status property: The value that indicates whether the policy is enabled or not. + * + * @param status the status value to set. + * @return the QuarantinePolicy object itself. + */ + public QuarantinePolicy withStatus(PolicyStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegenerateCredentialParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegenerateCredentialParameters.java new file mode 100644 index 000000000000..9fcf9aeacac0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegenerateCredentialParameters.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used to regenerate the login credential. */ +@Fluent +public final class RegenerateCredentialParameters { + /* + * Specifies name of the password which should be regenerated -- password + * or password2. + */ + @JsonProperty(value = "name", required = true) + private PasswordName name; + + /** + * Get the name property: Specifies name of the password which should be regenerated -- password or password2. + * + * @return the name value. + */ + public PasswordName name() { + return this.name; + } + + /** + * Set the name property: Specifies name of the password which should be regenerated -- password or password2. + * + * @param name the name value to set. + * @return the RegenerateCredentialParameters object itself. + */ + public RegenerateCredentialParameters withName(PasswordName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model RegenerateCredentialParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RegenerateCredentialParameters.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registries.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registries.java new file mode 100644 index 000000000000..0bb50c26f9ee --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registries.java @@ -0,0 +1,381 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Registries. */ +public interface Registries { + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters); + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters, Context context); + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric + * characters, be globally unique, and between 5 and 50 characters in length. + * + * @param registryNameCheckRequest The object containing information for the availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name. + */ + RegistryNameStatus checkNameAvailability(RegistryNameCheckRequest registryNameCheckRequest); + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric + * characters, be globally unique, and between 5 and 50 characters in length. + * + * @param registryNameCheckRequest The object containing information for the availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to check the availability of a container registry name along with {@link + * Response}. + */ + Response checkNameAvailabilityWithResponse( + RegistryNameCheckRequest registryNameCheckRequest, Context context); + + /** + * Lists all the container registries under the specified subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all the container registries under the specified subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list container registries as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry. + */ + Registry getByResourceGroup(String resourceGroupName, String registryName); + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String registryName, Context context); + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String registryName); + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, Context context); + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry. + */ + RegistryUsageListResult listUsages(String resourceGroupName, String registryName); + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the quota usages for the specified container registry along with {@link Response}. + */ + Response listUsagesWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listPrivateLinkResources(String resourceGroupName, String registryName); + + /** + * Lists the private link resources for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list private link resources for a container registry as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listPrivateLinkResources( + String resourceGroupName, String registryName, Context context); + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry. + */ + PrivateLinkResource getPrivateLinkResource(String resourceGroupName, String registryName, String groupName); + + /** + * Gets a private link resource by a specified group name for a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource by a specified group name for a container registry along with {@link Response}. + */ + Response getPrivateLinkResourceWithResponse( + String resourceGroupName, String registryName, String groupName, Context context); + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + RegistryListCredentialsResult listCredentials(String resourceGroupName, String registryName); + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation along with {@link Response}. + */ + Response listCredentialsWithResponse( + String resourceGroupName, String registryName, Context context); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + RegistryListCredentialsResult regenerateCredential( + String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation along with {@link Response}. + */ + Response regenerateCredentialWithResponse( + String resourceGroupName, + String registryName, + RegenerateCredentialParameters regenerateCredentialParameters, + Context context); + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + GenerateCredentialsResult generateCredentials( + String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters); + + /** + * Generate keys for a token of a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + GenerateCredentialsResult generateCredentials( + String resourceGroupName, + String registryName, + GenerateCredentialsParameters generateCredentialsParameters, + Context context); + + /** + * Gets the properties of the specified container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry along with {@link Response}. + */ + Registry getById(String id); + + /** + * Gets the properties of the specified container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified container registry along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Registry resource. + * + * @param name resource name. + * @return the first stage of the new Registry definition. + */ + Registry.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registry.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registry.java new file mode 100644 index 000000000000..ebec49cbb9be --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Registry.java @@ -0,0 +1,657 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Registry. */ +public interface Registry { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: The SKU of the container registry. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the identity property: The identity of the container registry. + * + * @return the identity value. + */ + IdentityProperties identity(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the loginServer property: The URL that can be used to log into the container registry. + * + * @return the loginServer value. + */ + String loginServer(); + + /** + * Gets the creationDate property: The creation date of the container registry in ISO8601 format. + * + * @return the creationDate value. + */ + OffsetDateTime creationDate(); + + /** + * Gets the provisioningState property: The provisioning state of the container registry at the time the operation + * was called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the status property: The status of the container registry at the time the operation was called. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the adminUserEnabled property: The value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value. + */ + Boolean adminUserEnabled(); + + /** + * Gets the networkRuleSet property: The network rule set for a container registry. + * + * @return the networkRuleSet value. + */ + NetworkRuleSet networkRuleSet(); + + /** + * Gets the policies property: The policies for a container registry. + * + * @return the policies value. + */ + Policies policies(); + + /** + * Gets the encryption property: The encryption settings of container registry. + * + * @return the encryption value. + */ + EncryptionProperty encryption(); + + /** + * Gets the dataEndpointEnabled property: Enable a single data endpoint per region for serving data. + * + * @return the dataEndpointEnabled value. + */ + Boolean dataEndpointEnabled(); + + /** + * Gets the dataEndpointHostNames property: List of host names that will serve data when dataEndpointEnabled is + * true. + * + * @return the dataEndpointHostNames value. + */ + List dataEndpointHostNames(); + + /** + * Gets the privateEndpointConnections property: List of private endpoint connections for a container registry. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the publicNetworkAccess property: Whether or not public network access is allowed for the container + * registry. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a network + * restricted registry. + * + * @return the networkRuleBypassOptions value. + */ + NetworkRuleBypassOptions networkRuleBypassOptions(); + + /** + * Gets the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry. + * + * @return the zoneRedundancy value. + */ + ZoneRedundancy zoneRedundancy(); + + /** + * Gets the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @return the anonymousPullEnabled value. + */ + Boolean anonymousPullEnabled(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryInner object. + * + * @return the inner object. + */ + RegistryInner innerModel(); + + /** The entirety of the Registry definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithSku, + DefinitionStages.WithCreate { + } + /** The Registry definition stages. */ + interface DefinitionStages { + /** The first stage of the Registry definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Registry definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Registry definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @return the next definition stage. + */ + WithSku withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the Registry definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the container registry.. + * + * @param sku The SKU of the container registry. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** + * The stage of the Registry definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithAdminUserEnabled, + DefinitionStages.WithNetworkRuleSet, + DefinitionStages.WithPolicies, + DefinitionStages.WithEncryption, + DefinitionStages.WithDataEndpointEnabled, + DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithNetworkRuleBypassOptions, + DefinitionStages.WithZoneRedundancy, + DefinitionStages.WithAnonymousPullEnabled { + /** + * Executes the create request. + * + * @return the created resource. + */ + Registry create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Registry create(Context context); + } + /** The stage of the Registry definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Registry definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the container registry.. + * + * @param identity The identity of the container registry. + * @return the next definition stage. + */ + WithCreate withIdentity(IdentityProperties identity); + } + /** The stage of the Registry definition allowing to specify adminUserEnabled. */ + interface WithAdminUserEnabled { + /** + * Specifies the adminUserEnabled property: The value that indicates whether the admin user is enabled.. + * + * @param adminUserEnabled The value that indicates whether the admin user is enabled. + * @return the next definition stage. + */ + WithCreate withAdminUserEnabled(Boolean adminUserEnabled); + } + /** The stage of the Registry definition allowing to specify networkRuleSet. */ + interface WithNetworkRuleSet { + /** + * Specifies the networkRuleSet property: The network rule set for a container registry.. + * + * @param networkRuleSet The network rule set for a container registry. + * @return the next definition stage. + */ + WithCreate withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + /** The stage of the Registry definition allowing to specify policies. */ + interface WithPolicies { + /** + * Specifies the policies property: The policies for a container registry.. + * + * @param policies The policies for a container registry. + * @return the next definition stage. + */ + WithCreate withPolicies(Policies policies); + } + /** The stage of the Registry definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: The encryption settings of container registry.. + * + * @param encryption The encryption settings of container registry. + * @return the next definition stage. + */ + WithCreate withEncryption(EncryptionProperty encryption); + } + /** The stage of the Registry definition allowing to specify dataEndpointEnabled. */ + interface WithDataEndpointEnabled { + /** + * Specifies the dataEndpointEnabled property: Enable a single data endpoint per region for serving data.. + * + * @param dataEndpointEnabled Enable a single data endpoint per region for serving data. + * @return the next definition stage. + */ + WithCreate withDataEndpointEnabled(Boolean dataEndpointEnabled); + } + /** The stage of the Registry definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Whether or not public network access is allowed for the + * container registry.. + * + * @param publicNetworkAccess Whether or not public network access is allowed for the container registry. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the Registry definition allowing to specify networkRuleBypassOptions. */ + interface WithNetworkRuleBypassOptions { + /** + * Specifies the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a + * network restricted registry.. + * + * @param networkRuleBypassOptions Whether to allow trusted Azure services to access a network restricted + * registry. + * @return the next definition stage. + */ + WithCreate withNetworkRuleBypassOptions(NetworkRuleBypassOptions networkRuleBypassOptions); + } + /** The stage of the Registry definition allowing to specify zoneRedundancy. */ + interface WithZoneRedundancy { + /** + * Specifies the zoneRedundancy property: Whether or not zone redundancy is enabled for this container + * registry. + * + * @param zoneRedundancy Whether or not zone redundancy is enabled for this container registry. + * @return the next definition stage. + */ + WithCreate withZoneRedundancy(ZoneRedundancy zoneRedundancy); + } + /** The stage of the Registry definition allowing to specify anonymousPullEnabled. */ + interface WithAnonymousPullEnabled { + /** + * Specifies the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients.. + * + * @param anonymousPullEnabled Enables registry-wide pull from unauthenticated clients. + * @return the next definition stage. + */ + WithCreate withAnonymousPullEnabled(Boolean anonymousPullEnabled); + } + } + /** + * Begins update for the Registry resource. + * + * @return the stage of resource update. + */ + Registry.Update update(); + + /** The template for Registry update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithSku, + UpdateStages.WithAdminUserEnabled, + UpdateStages.WithNetworkRuleSet, + UpdateStages.WithPolicies, + UpdateStages.WithEncryption, + UpdateStages.WithDataEndpointEnabled, + UpdateStages.WithPublicNetworkAccess, + UpdateStages.WithNetworkRuleBypassOptions, + UpdateStages.WithAnonymousPullEnabled { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Registry apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Registry apply(Context context); + } + /** The Registry update stages. */ + interface UpdateStages { + /** The stage of the Registry update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags for the container registry.. + * + * @param tags The tags for the container registry. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Registry update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the container registry.. + * + * @param identity The identity of the container registry. + * @return the next definition stage. + */ + Update withIdentity(IdentityProperties identity); + } + /** The stage of the Registry update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The SKU of the container registry.. + * + * @param sku The SKU of the container registry. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + /** The stage of the Registry update allowing to specify adminUserEnabled. */ + interface WithAdminUserEnabled { + /** + * Specifies the adminUserEnabled property: The value that indicates whether the admin user is enabled.. + * + * @param adminUserEnabled The value that indicates whether the admin user is enabled. + * @return the next definition stage. + */ + Update withAdminUserEnabled(Boolean adminUserEnabled); + } + /** The stage of the Registry update allowing to specify networkRuleSet. */ + interface WithNetworkRuleSet { + /** + * Specifies the networkRuleSet property: The network rule set for a container registry.. + * + * @param networkRuleSet The network rule set for a container registry. + * @return the next definition stage. + */ + Update withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + /** The stage of the Registry update allowing to specify policies. */ + interface WithPolicies { + /** + * Specifies the policies property: The policies for a container registry.. + * + * @param policies The policies for a container registry. + * @return the next definition stage. + */ + Update withPolicies(Policies policies); + } + /** The stage of the Registry update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: The encryption settings of container registry.. + * + * @param encryption The encryption settings of container registry. + * @return the next definition stage. + */ + Update withEncryption(EncryptionProperty encryption); + } + /** The stage of the Registry update allowing to specify dataEndpointEnabled. */ + interface WithDataEndpointEnabled { + /** + * Specifies the dataEndpointEnabled property: Enable a single data endpoint per region for serving data.. + * + * @param dataEndpointEnabled Enable a single data endpoint per region for serving data. + * @return the next definition stage. + */ + Update withDataEndpointEnabled(Boolean dataEndpointEnabled); + } + /** The stage of the Registry update allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Whether or not public network access is allowed for the + * container registry.. + * + * @param publicNetworkAccess Whether or not public network access is allowed for the container registry. + * @return the next definition stage. + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the Registry update allowing to specify networkRuleBypassOptions. */ + interface WithNetworkRuleBypassOptions { + /** + * Specifies the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a + * network restricted registry.. + * + * @param networkRuleBypassOptions Whether to allow trusted Azure services to access a network restricted + * registry. + * @return the next definition stage. + */ + Update withNetworkRuleBypassOptions(NetworkRuleBypassOptions networkRuleBypassOptions); + } + /** The stage of the Registry update allowing to specify anonymousPullEnabled. */ + interface WithAnonymousPullEnabled { + /** + * Specifies the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients.. + * + * @param anonymousPullEnabled Enables registry-wide pull from unauthenticated clients. + * @return the next definition stage. + */ + Update withAnonymousPullEnabled(Boolean anonymousPullEnabled); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Registry refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Registry refresh(Context context); + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void importImage(ImportImageParameters parameters); + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void importImage(ImportImageParameters parameters, Context context); + + /** + * Lists the login credentials for the specified container registry. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + RegistryListCredentialsResult listCredentials(); + + /** + * Lists the login credentials for the specified container registry. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation along with {@link Response}. + */ + Response listCredentialsWithResponse(Context context); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation. + */ + RegistryListCredentialsResult regenerateCredential(RegenerateCredentialParameters regenerateCredentialParameters); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param regenerateCredentialParameters Specifies name of the password which should be regenerated -- password or + * password2. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the ListCredentials operation along with {@link Response}. + */ + Response regenerateCredentialWithResponse( + RegenerateCredentialParameters regenerateCredentialParameters, Context context); + + /** + * Generate keys for a token of a specified container registry. + * + * @param generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + GenerateCredentialsResult generateCredentials(GenerateCredentialsParameters generateCredentialsParameters); + + /** + * Generate keys for a token of a specified container registry. + * + * @param generateCredentialsParameters The parameters for generating credentials. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the GenerateCredentials operation. + */ + GenerateCredentialsResult generateCredentials( + GenerateCredentialsParameters generateCredentialsParameters, Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryListCredentialsResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryListCredentialsResult.java new file mode 100644 index 000000000000..cda334babe26 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryListCredentialsResult.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryListCredentialsResultInner; +import java.util.List; + +/** An immutable client-side representation of RegistryListCredentialsResult. */ +public interface RegistryListCredentialsResult { + /** + * Gets the username property: The username for a container registry. + * + * @return the username value. + */ + String username(); + + /** + * Gets the passwords property: The list of passwords for a container registry. + * + * @return the passwords value. + */ + List passwords(); + + /** + * Gets the inner + * com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryListCredentialsResultInner object. + * + * @return the inner object. + */ + RegistryListCredentialsResultInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryListResult.java new file mode 100644 index 000000000000..e7ab7ee352f4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryListResult.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list container registries. */ +@Fluent +public final class RegistryListResult { + /* + * The list of container registries. Since this list may be incomplete, the + * nextLink field should be used to request the next list of container + * registries. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of container + * registries. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of container registries. Since this list may be incomplete, the nextLink field + * should be used to request the next list of container registries. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of container registries. Since this list may be incomplete, the nextLink field + * should be used to request the next list of container registries. + * + * @param value the value value to set. + * @return the RegistryListResult object itself. + */ + public RegistryListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of container registries. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of container registries. + * + * @param nextLink the nextLink value to set. + * @return the RegistryListResult object itself. + */ + public RegistryListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryNameCheckRequest.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryNameCheckRequest.java new file mode 100644 index 000000000000..136bb90baba5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryNameCheckRequest.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A request to check whether a container registry name is available. */ +@Fluent +public final class RegistryNameCheckRequest { + /* + * The name of the container registry. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The resource type of the container registry. This field must be set to + * 'Microsoft.ContainerRegistry/registries'. + */ + @JsonProperty(value = "type", required = true) + private String type = "Microsoft.ContainerRegistry/registries"; + + /** Creates an instance of RegistryNameCheckRequest class. */ + public RegistryNameCheckRequest() { + type = "Microsoft.ContainerRegistry/registries"; + } + + /** + * Get the name property: The name of the container registry. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the container registry. + * + * @param name the name value to set. + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The resource type of the container registry. This field must be set to + * 'Microsoft.ContainerRegistry/registries'. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The resource type of the container registry. This field must be set to + * 'Microsoft.ContainerRegistry/registries'. + * + * @param type the type value to set. + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model RegistryNameCheckRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RegistryNameCheckRequest.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryNameStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryNameStatus.java new file mode 100644 index 000000000000..81b95497f6e7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryNameStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryNameStatusInner; + +/** An immutable client-side representation of RegistryNameStatus. */ +public interface RegistryNameStatus { + /** + * Gets the nameAvailable property: The value that indicates whether the name is available. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: If any, the reason that the name is not available. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the message property: If any, the error message that provides more detail for the reason that the name is + * not available. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryNameStatusInner + * object. + * + * @return the inner object. + */ + RegistryNameStatusInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryPassword.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryPassword.java new file mode 100644 index 000000000000..a15da5521a8f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryPassword.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The login password for the container registry. */ +@Fluent +public final class RegistryPassword { + /* + * The password name. + */ + @JsonProperty(value = "name") + private PasswordName name; + + /* + * The password value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name property: The password name. + * + * @return the name value. + */ + public PasswordName name() { + return this.name; + } + + /** + * Set the name property: The password name. + * + * @param name the name value to set. + * @return the RegistryPassword object itself. + */ + public RegistryPassword withName(PasswordName name) { + this.name = name; + return this; + } + + /** + * Get the value property: The password value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The password value. + * + * @param value the value value to set. + * @return the RegistryPassword object itself. + */ + public RegistryPassword withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUpdateParameters.java new file mode 100644 index 000000000000..ad13c824386d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUpdateParameters.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryPropertiesUpdateParameters; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters for updating a container registry. */ +@Fluent +public final class RegistryUpdateParameters { + /* + * The identity of the container registry. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /* + * The tags for the container registry. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The SKU of the container registry. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * The properties that the container registry will be updated with. + */ + @JsonProperty(value = "properties") + private RegistryPropertiesUpdateParameters innerProperties; + + /** + * Get the identity property: The identity of the container registry. + * + * @return the identity value. + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the container registry. + * + * @param identity the identity value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the tags property: The tags for the container registry. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags for the container registry. + * + * @param tags the tags value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku property: The SKU of the container registry. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the container registry. + * + * @param sku the sku value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the innerProperties property: The properties that the container registry will be updated with. + * + * @return the innerProperties value. + */ + private RegistryPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the adminUserEnabled property: The value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value. + */ + public Boolean adminUserEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().adminUserEnabled(); + } + + /** + * Set the adminUserEnabled property: The value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withAdminUserEnabled(Boolean adminUserEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withAdminUserEnabled(adminUserEnabled); + return this; + } + + /** + * Get the networkRuleSet property: The network rule set for a container registry. + * + * @return the networkRuleSet value. + */ + public NetworkRuleSet networkRuleSet() { + return this.innerProperties() == null ? null : this.innerProperties().networkRuleSet(); + } + + /** + * Set the networkRuleSet property: The network rule set for a container registry. + * + * @param networkRuleSet the networkRuleSet value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withNetworkRuleSet(networkRuleSet); + return this; + } + + /** + * Get the policies property: The policies for a container registry. + * + * @return the policies value. + */ + public Policies policies() { + return this.innerProperties() == null ? null : this.innerProperties().policies(); + } + + /** + * Set the policies property: The policies for a container registry. + * + * @param policies the policies value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withPolicies(Policies policies) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withPolicies(policies); + return this; + } + + /** + * Get the encryption property: The encryption settings of container registry. + * + * @return the encryption value. + */ + public EncryptionProperty encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: The encryption settings of container registry. + * + * @param encryption the encryption value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withEncryption(EncryptionProperty encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the dataEndpointEnabled property: Enable a single data endpoint per region for serving data. + * + * @return the dataEndpointEnabled value. + */ + public Boolean dataEndpointEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().dataEndpointEnabled(); + } + + /** + * Set the dataEndpointEnabled property: Enable a single data endpoint per region for serving data. + * + * @param dataEndpointEnabled the dataEndpointEnabled value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withDataEndpointEnabled(Boolean dataEndpointEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withDataEndpointEnabled(dataEndpointEnabled); + return this; + } + + /** + * Get the publicNetworkAccess property: Whether or not public network access is allowed for the container registry. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Whether or not public network access is allowed for the container registry. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a network restricted + * registry. + * + * @return the networkRuleBypassOptions value. + */ + public NetworkRuleBypassOptions networkRuleBypassOptions() { + return this.innerProperties() == null ? null : this.innerProperties().networkRuleBypassOptions(); + } + + /** + * Set the networkRuleBypassOptions property: Whether to allow trusted Azure services to access a network restricted + * registry. + * + * @param networkRuleBypassOptions the networkRuleBypassOptions value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withNetworkRuleBypassOptions(NetworkRuleBypassOptions networkRuleBypassOptions) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withNetworkRuleBypassOptions(networkRuleBypassOptions); + return this; + } + + /** + * Get the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @return the anonymousPullEnabled value. + */ + public Boolean anonymousPullEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().anonymousPullEnabled(); + } + + /** + * Set the anonymousPullEnabled property: Enables registry-wide pull from unauthenticated clients. + * + * @param anonymousPullEnabled the anonymousPullEnabled value to set. + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withAnonymousPullEnabled(Boolean anonymousPullEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new RegistryPropertiesUpdateParameters(); + } + this.innerProperties().withAnonymousPullEnabled(anonymousPullEnabled); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsage.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsage.java new file mode 100644 index 000000000000..c5917fa872e0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsage.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The quota usage for a container registry. */ +@Fluent +public final class RegistryUsage { + /* + * The name of the usage. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The limit of the usage. + */ + @JsonProperty(value = "limit") + private Long limit; + + /* + * The current value of the usage. + */ + @JsonProperty(value = "currentValue") + private Long currentValue; + + /* + * The unit of measurement. + */ + @JsonProperty(value = "unit") + private RegistryUsageUnit unit; + + /** + * Get the name property: The name of the usage. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the usage. + * + * @param name the name value to set. + * @return the RegistryUsage object itself. + */ + public RegistryUsage withName(String name) { + this.name = name; + return this; + } + + /** + * Get the limit property: The limit of the usage. + * + * @return the limit value. + */ + public Long limit() { + return this.limit; + } + + /** + * Set the limit property: The limit of the usage. + * + * @param limit the limit value to set. + * @return the RegistryUsage object itself. + */ + public RegistryUsage withLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Get the currentValue property: The current value of the usage. + * + * @return the currentValue value. + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: The current value of the usage. + * + * @param currentValue the currentValue value to set. + * @return the RegistryUsage object itself. + */ + public RegistryUsage withCurrentValue(Long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the unit property: The unit of measurement. + * + * @return the unit value. + */ + public RegistryUsageUnit unit() { + return this.unit; + } + + /** + * Set the unit property: The unit of measurement. + * + * @param unit the unit value to set. + * @return the RegistryUsage object itself. + */ + public RegistryUsage withUnit(RegistryUsageUnit unit) { + this.unit = unit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsageListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsageListResult.java new file mode 100644 index 000000000000..a32700d1b5df --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsageListResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryUsageListResultInner; +import java.util.List; + +/** An immutable client-side representation of RegistryUsageListResult. */ +public interface RegistryUsageListResult { + /** + * Gets the value property: The list of container registry quota usages. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.RegistryUsageListResultInner + * object. + * + * @return the inner object. + */ + RegistryUsageListResultInner innerModel(); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsageUnit.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsageUnit.java new file mode 100644 index 000000000000..84f65fb1b117 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RegistryUsageUnit.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RegistryUsageUnit. */ +public final class RegistryUsageUnit extends ExpandableStringEnum { + /** Static value Count for RegistryUsageUnit. */ + public static final RegistryUsageUnit COUNT = fromString("Count"); + + /** Static value Bytes for RegistryUsageUnit. */ + public static final RegistryUsageUnit BYTES = fromString("Bytes"); + + /** + * Creates or finds a RegistryUsageUnit from its string representation. + * + * @param name a name to look for. + * @return the corresponding RegistryUsageUnit. + */ + @JsonCreator + public static RegistryUsageUnit fromString(String name) { + return fromString(name, RegistryUsageUnit.class); + } + + /** @return known RegistryUsageUnit values. */ + public static Collection values() { + return values(RegistryUsageUnit.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replication.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replication.java new file mode 100644 index 000000000000..ac1e469fc2e3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replication.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ReplicationInner; +import java.util.Map; + +/** An immutable client-side representation of Replication. */ +public interface Replication { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: The provisioning state of the replication at the time the operation was + * called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the status property: The status of the replication at the time the operation was called. + * + * @return the status value. + */ + Status status(); + + /** + * Gets the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue + * to be synced with other replications. + * + * @return the regionEndpointEnabled value. + */ + Boolean regionEndpointEnabled(); + + /** + * Gets the zoneRedundancy property: Whether or not zone redundancy is enabled for this container registry + * replication. + * + * @return the zoneRedundancy value. + */ + ZoneRedundancy zoneRedundancy(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.ReplicationInner object. + * + * @return the inner object. + */ + ReplicationInner innerModel(); + + /** The entirety of the Replication definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The Replication definition stages. */ + interface DefinitionStages { + /** The first stage of the Replication definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Replication definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Replication definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the Replication definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithRegionEndpointEnabled, + DefinitionStages.WithZoneRedundancy { + /** + * Executes the create request. + * + * @return the created resource. + */ + Replication create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Replication create(Context context); + } + /** The stage of the Replication definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Replication definition allowing to specify regionEndpointEnabled. */ + interface WithRegionEndpointEnabled { + /** + * Specifies the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is + * enabled. Requests will not be routed to a replication whose regional endpoint is disabled, however its + * data will continue to be synced with other replications.. + * + * @param regionEndpointEnabled Specifies whether the replication's regional endpoint is enabled. Requests + * will not be routed to a replication whose regional endpoint is disabled, however its data will + * continue to be synced with other replications. + * @return the next definition stage. + */ + WithCreate withRegionEndpointEnabled(Boolean regionEndpointEnabled); + } + /** The stage of the Replication definition allowing to specify zoneRedundancy. */ + interface WithZoneRedundancy { + /** + * Specifies the zoneRedundancy property: Whether or not zone redundancy is enabled for this container + * registry replication. + * + * @param zoneRedundancy Whether or not zone redundancy is enabled for this container registry replication. + * @return the next definition stage. + */ + WithCreate withZoneRedundancy(ZoneRedundancy zoneRedundancy); + } + } + /** + * Begins update for the Replication resource. + * + * @return the stage of resource update. + */ + Replication.Update update(); + + /** The template for Replication update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithRegionEndpointEnabled { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Replication apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Replication apply(Context context); + } + /** The Replication update stages. */ + interface UpdateStages { + /** The stage of the Replication update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags for the replication.. + * + * @param tags The tags for the replication. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Replication update allowing to specify regionEndpointEnabled. */ + interface WithRegionEndpointEnabled { + /** + * Specifies the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is + * enabled. Requests will not be routed to a replication whose regional endpoint is disabled, however its + * data will continue to be synced with other replications.. + * + * @param regionEndpointEnabled Specifies whether the replication's regional endpoint is enabled. Requests + * will not be routed to a replication whose regional endpoint is disabled, however its data will + * continue to be synced with other replications. + * @return the next definition stage. + */ + Update withRegionEndpointEnabled(Boolean regionEndpointEnabled); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Replication refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Replication refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ReplicationListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ReplicationListResult.java new file mode 100644 index 000000000000..65e5c0292856 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ReplicationListResult.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ReplicationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list replications for a container registry. */ +@Fluent +public final class ReplicationListResult { + /* + * The list of replications. Since this list may be incomplete, the + * nextLink field should be used to request the next list of replications. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of replications. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of replications. Since this list may be incomplete, the nextLink field should be + * used to request the next list of replications. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of replications. Since this list may be incomplete, the nextLink field should be + * used to request the next list of replications. + * + * @param value the value value to set. + * @return the ReplicationListResult object itself. + */ + public ReplicationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of replications. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of replications. + * + * @param nextLink the nextLink value to set. + * @return the ReplicationListResult object itself. + */ + public ReplicationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ReplicationUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ReplicationUpdateParameters.java new file mode 100644 index 000000000000..a4f12cc8084f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ReplicationUpdateParameters.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ReplicationUpdateParametersProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters for updating a replication. */ +@Fluent +public final class ReplicationUpdateParameters { + /* + * The tags for the replication. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The parameters for updating a replication's properties + */ + @JsonProperty(value = "properties") + private ReplicationUpdateParametersProperties innerProperties; + + /** + * Get the tags property: The tags for the replication. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags for the replication. + * + * @param tags the tags value to set. + * @return the ReplicationUpdateParameters object itself. + */ + public ReplicationUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the innerProperties property: The parameters for updating a replication's properties. + * + * @return the innerProperties value. + */ + private ReplicationUpdateParametersProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue + * to be synced with other replications. + * + * @return the regionEndpointEnabled value. + */ + public Boolean regionEndpointEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().regionEndpointEnabled(); + } + + /** + * Set the regionEndpointEnabled property: Specifies whether the replication's regional endpoint is enabled. + * Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue + * to be synced with other replications. + * + * @param regionEndpointEnabled the regionEndpointEnabled value to set. + * @return the ReplicationUpdateParameters object itself. + */ + public ReplicationUpdateParameters withRegionEndpointEnabled(Boolean regionEndpointEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new ReplicationUpdateParametersProperties(); + } + this.innerProperties().withRegionEndpointEnabled(regionEndpointEnabled); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replications.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replications.java new file mode 100644 index 000000000000..8180e42c3ab2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Replications.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Replications. */ +public interface Replications { + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list replications for a container registry as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication. + */ + Replication get(String resourceGroupName, String registryName, String replicationName); + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String replicationName, Context context); + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String replicationName); + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String replicationName, Context context); + + /** + * Gets the properties of the specified replication. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication along with {@link Response}. + */ + Replication getById(String id); + + /** + * Gets the properties of the specified replication. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified replication along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a replication from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a replication from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Replication resource. + * + * @param name resource name. + * @return the first stage of the new Replication definition. + */ + Replication.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Request.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Request.java new file mode 100644 index 000000000000..7067ec434d0d --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Request.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The request that generated the event. */ +@Fluent +public final class Request { + /* + * The ID of the request that initiated the event. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The IP or hostname and possibly port of the client connection that + * initiated the event. This is the RemoteAddr from the standard http + * request. + */ + @JsonProperty(value = "addr") + private String addr; + + /* + * The externally accessible hostname of the registry instance, as + * specified by the http host header on incoming requests. + */ + @JsonProperty(value = "host") + private String host; + + /* + * The request method that generated the event. + */ + @JsonProperty(value = "method") + private String method; + + /* + * The user agent header of the request. + */ + @JsonProperty(value = "useragent") + private String useragent; + + /** + * Get the id property: The ID of the request that initiated the event. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of the request that initiated the event. + * + * @param id the id value to set. + * @return the Request object itself. + */ + public Request withId(String id) { + this.id = id; + return this; + } + + /** + * Get the addr property: The IP or hostname and possibly port of the client connection that initiated the event. + * This is the RemoteAddr from the standard http request. + * + * @return the addr value. + */ + public String addr() { + return this.addr; + } + + /** + * Set the addr property: The IP or hostname and possibly port of the client connection that initiated the event. + * This is the RemoteAddr from the standard http request. + * + * @param addr the addr value to set. + * @return the Request object itself. + */ + public Request withAddr(String addr) { + this.addr = addr; + return this; + } + + /** + * Get the host property: The externally accessible hostname of the registry instance, as specified by the http host + * header on incoming requests. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Set the host property: The externally accessible hostname of the registry instance, as specified by the http host + * header on incoming requests. + * + * @param host the host value to set. + * @return the Request object itself. + */ + public Request withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the method property: The request method that generated the event. + * + * @return the method value. + */ + public String method() { + return this.method; + } + + /** + * Set the method property: The request method that generated the event. + * + * @param method the method value to set. + * @return the Request object itself. + */ + public Request withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the useragent property: The user agent header of the request. + * + * @return the useragent value. + */ + public String useragent() { + return this.useragent; + } + + /** + * Set the useragent property: The user agent header of the request. + * + * @param useragent the useragent value to set. + * @return the Request object itself. + */ + public Request withUseragent(String useragent) { + this.useragent = useragent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ResourceIdentityType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ResourceIdentityType.java new file mode 100644 index 000000000000..104dc6da087b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ResourceIdentityType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceIdentityType. */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RetentionPolicy.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RetentionPolicy.java new file mode 100644 index 000000000000..c3e7a1d8cdb9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/RetentionPolicy.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The retention policy for a container registry. */ +@Fluent +public final class RetentionPolicy { + /* + * The number of days to retain an untagged manifest after which it gets + * purged. + */ + @JsonProperty(value = "days") + private Integer days; + + /* + * The timestamp when the policy was last updated. + */ + @JsonProperty(value = "lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTime; + + /* + * The value that indicates whether the policy is enabled or not. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /** + * Get the days property: The number of days to retain an untagged manifest after which it gets purged. + * + * @return the days value. + */ + public Integer days() { + return this.days; + } + + /** + * Set the days property: The number of days to retain an untagged manifest after which it gets purged. + * + * @param days the days value to set. + * @return the RetentionPolicy object itself. + */ + public RetentionPolicy withDays(Integer days) { + this.days = days; + return this; + } + + /** + * Get the lastUpdatedTime property: The timestamp when the policy was last updated. + * + * @return the lastUpdatedTime value. + */ + public OffsetDateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Get the status property: The value that indicates whether the policy is enabled or not. + * + * @return the status value. + */ + public PolicyStatus status() { + return this.status; + } + + /** + * Set the status property: The value that indicates whether the policy is enabled or not. + * + * @param status the status value to set. + * @return the RetentionPolicy object itself. + */ + public RetentionPolicy withStatus(PolicyStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMap.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMap.java new file mode 100644 index 000000000000..e9beeeb61b96 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMap.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ScopeMapInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of ScopeMap. */ +public interface ScopeMap { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the description property: The user friendly description of the scope map. + * + * @return the description value. + */ + String description(); + + /** + * Gets the typePropertiesType property: The type of the scope map. E.g. BuildIn scope map. + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the creationDate property: The creation date of scope map. + * + * @return the creationDate value. + */ + OffsetDateTime creationDate(); + + /** + * Gets the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the actions property: The list of scoped permissions for registry artifacts. E.g. + * repositories/repository-name/content/read, repositories/repository-name/metadata/write. + * + * @return the actions value. + */ + List actions(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.ScopeMapInner object. + * + * @return the inner object. + */ + ScopeMapInner innerModel(); + + /** The entirety of the ScopeMap definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ScopeMap definition stages. */ + interface DefinitionStages { + /** The first stage of the ScopeMap definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ScopeMap definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the ScopeMap definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithDescription, DefinitionStages.WithActions { + /** + * Executes the create request. + * + * @return the created resource. + */ + ScopeMap create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ScopeMap create(Context context); + } + /** The stage of the ScopeMap definition allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The user friendly description of the scope map.. + * + * @param description The user friendly description of the scope map. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + /** The stage of the ScopeMap definition allowing to specify actions. */ + interface WithActions { + /** + * Specifies the actions property: The list of scoped permissions for registry artifacts. E.g. + * repositories/repository-name/content/read, repositories/repository-name/metadata/write. + * + * @param actions The list of scoped permissions for registry artifacts. E.g. + * repositories/repository-name/content/read, repositories/repository-name/metadata/write. + * @return the next definition stage. + */ + WithCreate withActions(List actions); + } + } + /** + * Begins update for the ScopeMap resource. + * + * @return the stage of resource update. + */ + ScopeMap.Update update(); + + /** The template for ScopeMap update. */ + interface Update extends UpdateStages.WithDescription, UpdateStages.WithActions { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ScopeMap apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ScopeMap apply(Context context); + } + /** The ScopeMap update stages. */ + interface UpdateStages { + /** The stage of the ScopeMap update allowing to specify description. */ + interface WithDescription { + /** + * Specifies the description property: The user friendly description of the scope map.. + * + * @param description The user friendly description of the scope map. + * @return the next definition stage. + */ + Update withDescription(String description); + } + /** The stage of the ScopeMap update allowing to specify actions. */ + interface WithActions { + /** + * Specifies the actions property: The list of scope permissions for registry artifacts. E.g. + * repositories/repository-name/pull, repositories/repository-name/delete. + * + * @param actions The list of scope permissions for registry artifacts. E.g. + * repositories/repository-name/pull, repositories/repository-name/delete. + * @return the next definition stage. + */ + Update withActions(List actions); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ScopeMap refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ScopeMap refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMapListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMapListResult.java new file mode 100644 index 000000000000..34b6662a43dd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMapListResult.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ScopeMapInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list scope maps for a container registry. */ +@Fluent +public final class ScopeMapListResult { + /* + * The list of scope maps. Since this list may be incomplete, the nextLink + * field should be used to request the next list of scope maps. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of scope maps. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of scope maps. Since this list may be incomplete, the nextLink field should be + * used to request the next list of scope maps. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of scope maps. Since this list may be incomplete, the nextLink field should be + * used to request the next list of scope maps. + * + * @param value the value value to set. + * @return the ScopeMapListResult object itself. + */ + public ScopeMapListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of scope maps. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of scope maps. + * + * @param nextLink the nextLink value to set. + * @return the ScopeMapListResult object itself. + */ + public ScopeMapListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMapUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMapUpdateParameters.java new file mode 100644 index 000000000000..2c1407fa3ccb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMapUpdateParameters.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.ScopeMapPropertiesUpdateParameters; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties for updating the scope map. */ +@Fluent +public final class ScopeMapUpdateParameters { + /* + * The update parameters for scope map properties. + */ + @JsonProperty(value = "properties") + private ScopeMapPropertiesUpdateParameters innerProperties; + + /** + * Get the innerProperties property: The update parameters for scope map properties. + * + * @return the innerProperties value. + */ + private ScopeMapPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the description property: The user friendly description of the scope map. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The user friendly description of the scope map. + * + * @param description the description value to set. + * @return the ScopeMapUpdateParameters object itself. + */ + public ScopeMapUpdateParameters withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ScopeMapPropertiesUpdateParameters(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the actions property: The list of scope permissions for registry artifacts. E.g. + * repositories/repository-name/pull, repositories/repository-name/delete. + * + * @return the actions value. + */ + public List actions() { + return this.innerProperties() == null ? null : this.innerProperties().actions(); + } + + /** + * Set the actions property: The list of scope permissions for registry artifacts. E.g. + * repositories/repository-name/pull, repositories/repository-name/delete. + * + * @param actions the actions value to set. + * @return the ScopeMapUpdateParameters object itself. + */ + public ScopeMapUpdateParameters withActions(List actions) { + if (this.innerProperties() == null) { + this.innerProperties = new ScopeMapPropertiesUpdateParameters(); + } + this.innerProperties().withActions(actions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMaps.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMaps.java new file mode 100644 index 000000000000..94375489c98e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ScopeMaps.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ScopeMaps. */ +public interface ScopeMaps { + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the scope maps for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list scope maps for a container registry as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map. + */ + ScopeMap get(String resourceGroupName, String registryName, String scopeMapName); + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String scopeMapName, Context context); + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String scopeMapName); + + /** + * Deletes a scope map from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String scopeMapName, Context context); + + /** + * Gets the properties of the specified scope map. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map along with {@link Response}. + */ + ScopeMap getById(String id); + + /** + * Gets the properties of the specified scope map. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified scope map along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a scope map from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a scope map from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ScopeMap resource. + * + * @param name resource name. + * @return the first stage of the new ScopeMap definition. + */ + ScopeMap.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Sku.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Sku.java new file mode 100644 index 000000000000..740653bb35db --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Sku.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SKU of a container registry. */ +@Fluent +public final class Sku { + /* + * The SKU name of the container registry. Required for registry creation. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /* + * The SKU tier based on the SKU name. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /** + * Get the name property: The SKU name of the container registry. Required for registry creation. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: The SKU name of the container registry. Required for registry creation. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The SKU tier based on the SKU name. + * + * @return the tier value. + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Sku.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuName.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuName.java new file mode 100644 index 000000000000..08a185d5f81a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuName.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuName. */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Classic for SkuName. */ + public static final SkuName CLASSIC = fromString("Classic"); + + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** Static value Premium for SkuName. */ + public static final SkuName PREMIUM = fromString("Premium"); + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** @return known SkuName values. */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuTier.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuTier.java new file mode 100644 index 000000000000..c1b59acaf444 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SkuTier.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuTier. */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Classic for SkuTier. */ + public static final SkuTier CLASSIC = fromString("Classic"); + + /** Static value Basic for SkuTier. */ + public static final SkuTier BASIC = fromString("Basic"); + + /** Static value Standard for SkuTier. */ + public static final SkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for SkuTier. */ + public static final SkuTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a SkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuTier. + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** @return known SkuTier values. */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SoftDeletePolicy.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SoftDeletePolicy.java new file mode 100644 index 000000000000..914ab2c95501 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SoftDeletePolicy.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The soft delete policy for a container registry. */ +@Fluent +public final class SoftDeletePolicy { + /* + * The number of days after which a soft-deleted item is permanently + * deleted. + */ + @JsonProperty(value = "retentionDays") + private Integer retentionDays; + + /* + * The timestamp when the policy was last updated. + */ + @JsonProperty(value = "lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTime; + + /* + * The value that indicates whether the policy is enabled or not. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /** + * Get the retentionDays property: The number of days after which a soft-deleted item is permanently deleted. + * + * @return the retentionDays value. + */ + public Integer retentionDays() { + return this.retentionDays; + } + + /** + * Set the retentionDays property: The number of days after which a soft-deleted item is permanently deleted. + * + * @param retentionDays the retentionDays value to set. + * @return the SoftDeletePolicy object itself. + */ + public SoftDeletePolicy withRetentionDays(Integer retentionDays) { + this.retentionDays = retentionDays; + return this; + } + + /** + * Get the lastUpdatedTime property: The timestamp when the policy was last updated. + * + * @return the lastUpdatedTime value. + */ + public OffsetDateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Get the status property: The value that indicates whether the policy is enabled or not. + * + * @return the status value. + */ + public PolicyStatus status() { + return this.status; + } + + /** + * Set the status property: The value that indicates whether the policy is enabled or not. + * + * @param status the status value to set. + * @return the SoftDeletePolicy object itself. + */ + public SoftDeletePolicy withStatus(PolicyStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Source.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Source.java new file mode 100644 index 000000000000..697fa9bb1562 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Source.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The registry node that generated the event. Put differently, while the actor initiates the event, the source + * generates it. + */ +@Fluent +public final class Source { + /* + * The IP or hostname and the port of the registry node that generated the + * event. Generally, this will be resolved by os.Hostname() along with the + * running port. + */ + @JsonProperty(value = "addr") + private String addr; + + /* + * The running instance of an application. Changes after each restart. + */ + @JsonProperty(value = "instanceID") + private String instanceId; + + /** + * Get the addr property: The IP or hostname and the port of the registry node that generated the event. Generally, + * this will be resolved by os.Hostname() along with the running port. + * + * @return the addr value. + */ + public String addr() { + return this.addr; + } + + /** + * Set the addr property: The IP or hostname and the port of the registry node that generated the event. Generally, + * this will be resolved by os.Hostname() along with the running port. + * + * @param addr the addr value to set. + * @return the Source object itself. + */ + public Source withAddr(String addr) { + this.addr = addr; + return this; + } + + /** + * Get the instanceId property: The running instance of an application. Changes after each restart. + * + * @return the instanceId value. + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Set the instanceId property: The running instance of an application. Changes after each restart. + * + * @param instanceId the instanceId value to set. + * @return the Source object itself. + */ + public Source withInstanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Status.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Status.java new file mode 100644 index 000000000000..56b6f1d752ad --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Status.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The status of an Azure resource at the time the operation was called. */ +@Immutable +public final class Status { + /* + * The short label for the status. + */ + @JsonProperty(value = "displayStatus", access = JsonProperty.Access.WRITE_ONLY) + private String displayStatus; + + /* + * The detailed message for the status, including alerts and error + * messages. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * The timestamp when the status was changed to the current value. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /** + * Get the displayStatus property: The short label for the status. + * + * @return the displayStatus value. + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Get the message property: The detailed message for the status, including alerts and error messages. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the timestamp property: The timestamp when the status was changed to the current value. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/StatusDetailProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/StatusDetailProperties.java new file mode 100644 index 000000000000..9a1122d7875a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/StatusDetailProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The status detail properties of the connected registry. */ +@Immutable +public final class StatusDetailProperties { + /* + * The component of the connected registry corresponding to the status. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The code of the status. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * The description of the status. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The timestamp of the status. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /* + * The correlation ID of the status. + */ + @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) + private String correlationId; + + /** + * Get the type property: The component of the connected registry corresponding to the status. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the code property: The code of the status. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the description property: The description of the status. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the timestamp property: The timestamp of the status. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the correlationId property: The correlation ID of the status. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncProperties.java new file mode 100644 index 000000000000..98142e1ec655 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncProperties.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; +import java.time.OffsetDateTime; + +/** The sync properties of the connected registry with its parent. */ +@Fluent +public final class SyncProperties { + /* + * The resource ID of the ACR token used to authenticate the connected + * registry to its parent during sync. + */ + @JsonProperty(value = "tokenId", required = true) + private String tokenId; + + /* + * The cron expression indicating the schedule that the connected registry + * will sync with its parent. + */ + @JsonProperty(value = "schedule") + private String schedule; + + /* + * The time window during which sync is enabled for each schedule + * occurrence. Specify the duration using the format + * P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + */ + @JsonProperty(value = "syncWindow") + private Duration syncWindow; + + /* + * The period of time for which a message is available to sync before it is + * expired. Specify the duration using the format + * P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + */ + @JsonProperty(value = "messageTtl", required = true) + private Duration messageTtl; + + /* + * The last time a sync occurred between the connected registry and its + * parent. + */ + @JsonProperty(value = "lastSyncTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastSyncTime; + + /* + * The gateway endpoint used by the connected registry to communicate with + * its parent. + */ + @JsonProperty(value = "gatewayEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String gatewayEndpoint; + + /** + * Get the tokenId property: The resource ID of the ACR token used to authenticate the connected registry to its + * parent during sync. + * + * @return the tokenId value. + */ + public String tokenId() { + return this.tokenId; + } + + /** + * Set the tokenId property: The resource ID of the ACR token used to authenticate the connected registry to its + * parent during sync. + * + * @param tokenId the tokenId value to set. + * @return the SyncProperties object itself. + */ + public SyncProperties withTokenId(String tokenId) { + this.tokenId = tokenId; + return this; + } + + /** + * Get the schedule property: The cron expression indicating the schedule that the connected registry will sync with + * its parent. + * + * @return the schedule value. + */ + public String schedule() { + return this.schedule; + } + + /** + * Set the schedule property: The cron expression indicating the schedule that the connected registry will sync with + * its parent. + * + * @param schedule the schedule value to set. + * @return the SyncProperties object itself. + */ + public SyncProperties withSchedule(String schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the syncWindow property: The time window during which sync is enabled for each schedule occurrence. Specify + * the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @return the syncWindow value. + */ + public Duration syncWindow() { + return this.syncWindow; + } + + /** + * Set the syncWindow property: The time window during which sync is enabled for each schedule occurrence. Specify + * the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @param syncWindow the syncWindow value to set. + * @return the SyncProperties object itself. + */ + public SyncProperties withSyncWindow(Duration syncWindow) { + this.syncWindow = syncWindow; + return this; + } + + /** + * Get the messageTtl property: The period of time for which a message is available to sync before it is expired. + * Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @return the messageTtl value. + */ + public Duration messageTtl() { + return this.messageTtl; + } + + /** + * Set the messageTtl property: The period of time for which a message is available to sync before it is expired. + * Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @param messageTtl the messageTtl value to set. + * @return the SyncProperties object itself. + */ + public SyncProperties withMessageTtl(Duration messageTtl) { + this.messageTtl = messageTtl; + return this; + } + + /** + * Get the lastSyncTime property: The last time a sync occurred between the connected registry and its parent. + * + * @return the lastSyncTime value. + */ + public OffsetDateTime lastSyncTime() { + return this.lastSyncTime; + } + + /** + * Get the gatewayEndpoint property: The gateway endpoint used by the connected registry to communicate with its + * parent. + * + * @return the gatewayEndpoint value. + */ + public String gatewayEndpoint() { + return this.gatewayEndpoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tokenId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property tokenId in model SyncProperties")); + } + if (messageTtl() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property messageTtl in model SyncProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SyncProperties.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncUpdateProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncUpdateProperties.java new file mode 100644 index 000000000000..fe8be1ad5cc5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/SyncUpdateProperties.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Duration; + +/** The parameters for updating the sync properties of the connected registry with its parent. */ +@Fluent +public final class SyncUpdateProperties { + /* + * The cron expression indicating the schedule that the connected registry + * will sync with its parent. + */ + @JsonProperty(value = "schedule") + private String schedule; + + /* + * The time window during which sync is enabled for each schedule + * occurrence. Specify the duration using the format + * P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + */ + @JsonProperty(value = "syncWindow") + private Duration syncWindow; + + /* + * The period of time for which a message is available to sync before it is + * expired. Specify the duration using the format + * P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + */ + @JsonProperty(value = "messageTtl") + private Duration messageTtl; + + /** + * Get the schedule property: The cron expression indicating the schedule that the connected registry will sync with + * its parent. + * + * @return the schedule value. + */ + public String schedule() { + return this.schedule; + } + + /** + * Set the schedule property: The cron expression indicating the schedule that the connected registry will sync with + * its parent. + * + * @param schedule the schedule value to set. + * @return the SyncUpdateProperties object itself. + */ + public SyncUpdateProperties withSchedule(String schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the syncWindow property: The time window during which sync is enabled for each schedule occurrence. Specify + * the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @return the syncWindow value. + */ + public Duration syncWindow() { + return this.syncWindow; + } + + /** + * Set the syncWindow property: The time window during which sync is enabled for each schedule occurrence. Specify + * the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @param syncWindow the syncWindow value to set. + * @return the SyncUpdateProperties object itself. + */ + public SyncUpdateProperties withSyncWindow(Duration syncWindow) { + this.syncWindow = syncWindow; + return this; + } + + /** + * Get the messageTtl property: The period of time for which a message is available to sync before it is expired. + * Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @return the messageTtl value. + */ + public Duration messageTtl() { + return this.messageTtl; + } + + /** + * Set the messageTtl property: The period of time for which a message is available to sync before it is expired. + * Specify the duration using the format P[n]Y[n]M[n]DT[n]H[n]M[n]S as per ISO8601. + * + * @param messageTtl the messageTtl value to set. + * @return the SyncUpdateProperties object itself. + */ + public SyncUpdateProperties withMessageTtl(Duration messageTtl) { + this.messageTtl = messageTtl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Target.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Target.java new file mode 100644 index 000000000000..b1468ae9458c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Target.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The target of the event. */ +@Fluent +public final class Target { + /* + * The MIME type of the referenced object. + */ + @JsonProperty(value = "mediaType") + private String mediaType; + + /* + * The number of bytes of the content. Same as Length field. + */ + @JsonProperty(value = "size") + private Long size; + + /* + * The digest of the content, as defined by the Registry V2 HTTP API + * Specification. + */ + @JsonProperty(value = "digest") + private String digest; + + /* + * The number of bytes of the content. Same as Size field. + */ + @JsonProperty(value = "length") + private Long length; + + /* + * The repository name. + */ + @JsonProperty(value = "repository") + private String repository; + + /* + * The direct URL to the content. + */ + @JsonProperty(value = "url") + private String url; + + /* + * The tag name. + */ + @JsonProperty(value = "tag") + private String tag; + + /* + * The name of the artifact. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The version of the artifact. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the mediaType property: The MIME type of the referenced object. + * + * @return the mediaType value. + */ + public String mediaType() { + return this.mediaType; + } + + /** + * Set the mediaType property: The MIME type of the referenced object. + * + * @param mediaType the mediaType value to set. + * @return the Target object itself. + */ + public Target withMediaType(String mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Get the size property: The number of bytes of the content. Same as Length field. + * + * @return the size value. + */ + public Long size() { + return this.size; + } + + /** + * Set the size property: The number of bytes of the content. Same as Length field. + * + * @param size the size value to set. + * @return the Target object itself. + */ + public Target withSize(Long size) { + this.size = size; + return this; + } + + /** + * Get the digest property: The digest of the content, as defined by the Registry V2 HTTP API Specification. + * + * @return the digest value. + */ + public String digest() { + return this.digest; + } + + /** + * Set the digest property: The digest of the content, as defined by the Registry V2 HTTP API Specification. + * + * @param digest the digest value to set. + * @return the Target object itself. + */ + public Target withDigest(String digest) { + this.digest = digest; + return this; + } + + /** + * Get the length property: The number of bytes of the content. Same as Size field. + * + * @return the length value. + */ + public Long length() { + return this.length; + } + + /** + * Set the length property: The number of bytes of the content. Same as Size field. + * + * @param length the length value to set. + * @return the Target object itself. + */ + public Target withLength(Long length) { + this.length = length; + return this; + } + + /** + * Get the repository property: The repository name. + * + * @return the repository value. + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository property: The repository name. + * + * @param repository the repository value to set. + * @return the Target object itself. + */ + public Target withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get the url property: The direct URL to the content. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: The direct URL to the content. + * + * @param url the url value to set. + * @return the Target object itself. + */ + public Target withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the tag property: The tag name. + * + * @return the tag value. + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag property: The tag name. + * + * @param tag the tag value to set. + * @return the Target object itself. + */ + public Target withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the name property: The name of the artifact. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the artifact. + * + * @param name the name value to set. + * @return the Target object itself. + */ + public Target withName(String name) { + this.name = name; + return this; + } + + /** + * Get the version property: The version of the artifact. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the artifact. + * + * @param version the version value to set. + * @return the Target object itself. + */ + public Target withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsCertificateProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsCertificateProperties.java new file mode 100644 index 000000000000..9ef99863a585 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsCertificateProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TLS certificate properties of the connected registry login server. */ +@Immutable +public final class TlsCertificateProperties { + /* + * The type of certificate location. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private CertificateType type; + + /* + * Indicates the location of the certificates. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * Get the type property: The type of certificate location. + * + * @return the type value. + */ + public CertificateType type() { + return this.type; + } + + /** + * Get the location property: Indicates the location of the certificates. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsProperties.java new file mode 100644 index 000000000000..2aaf813cc7cb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The TLS properties of the connected registry login server. */ +@Immutable +public final class TlsProperties { + /* + * Indicates whether HTTPS is enabled for the login server. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private TlsStatus status; + + /* + * The certificate used to configure HTTPS for the login server. + */ + @JsonProperty(value = "certificate", access = JsonProperty.Access.WRITE_ONLY) + private TlsCertificateProperties certificate; + + /** + * Get the status property: Indicates whether HTTPS is enabled for the login server. + * + * @return the status value. + */ + public TlsStatus status() { + return this.status; + } + + /** + * Get the certificate property: The certificate used to configure HTTPS for the login server. + * + * @return the certificate value. + */ + public TlsCertificateProperties certificate() { + return this.certificate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificate() != null) { + certificate().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsStatus.java new file mode 100644 index 000000000000..2a0e1fc72047 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TlsStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TlsStatus. */ +public final class TlsStatus extends ExpandableStringEnum { + /** Static value Enabled for TlsStatus. */ + public static final TlsStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for TlsStatus. */ + public static final TlsStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a TlsStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TlsStatus. + */ + @JsonCreator + public static TlsStatus fromString(String name) { + return fromString(name, TlsStatus.class); + } + + /** @return known TlsStatus values. */ + public static Collection values() { + return values(TlsStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Token.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Token.java new file mode 100644 index 000000000000..fed6988ca5c2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Token.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TokenInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of Token. */ +public interface Token { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the creationDate property: The creation date of scope map. + * + * @return the creationDate value. + */ + OffsetDateTime creationDate(); + + /** + * Gets the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the scopeMapId property: The resource ID of the scope map to which the token will be associated with. + * + * @return the scopeMapId value. + */ + String scopeMapId(); + + /** + * Gets the credentials property: The credentials that can be used for authenticating the token. + * + * @return the credentials value. + */ + TokenCredentialsProperties credentials(); + + /** + * Gets the status property: The status of the token example enabled or disabled. + * + * @return the status value. + */ + TokenStatus status(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.TokenInner object. + * + * @return the inner object. + */ + TokenInner innerModel(); + + /** The entirety of the Token definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Token definition stages. */ + interface DefinitionStages { + /** The first stage of the Token definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Token definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the Token definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithScopeMapId, DefinitionStages.WithCredentials, DefinitionStages.WithStatus { + /** + * Executes the create request. + * + * @return the created resource. + */ + Token create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Token create(Context context); + } + /** The stage of the Token definition allowing to specify scopeMapId. */ + interface WithScopeMapId { + /** + * Specifies the scopeMapId property: The resource ID of the scope map to which the token will be associated + * with.. + * + * @param scopeMapId The resource ID of the scope map to which the token will be associated with. + * @return the next definition stage. + */ + WithCreate withScopeMapId(String scopeMapId); + } + /** The stage of the Token definition allowing to specify credentials. */ + interface WithCredentials { + /** + * Specifies the credentials property: The credentials that can be used for authenticating the token.. + * + * @param credentials The credentials that can be used for authenticating the token. + * @return the next definition stage. + */ + WithCreate withCredentials(TokenCredentialsProperties credentials); + } + /** The stage of the Token definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The status of the token example enabled or disabled.. + * + * @param status The status of the token example enabled or disabled. + * @return the next definition stage. + */ + WithCreate withStatus(TokenStatus status); + } + } + /** + * Begins update for the Token resource. + * + * @return the stage of resource update. + */ + Token.Update update(); + + /** The template for Token update. */ + interface Update extends UpdateStages.WithScopeMapId, UpdateStages.WithStatus, UpdateStages.WithCredentials { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Token apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Token apply(Context context); + } + /** The Token update stages. */ + interface UpdateStages { + /** The stage of the Token update allowing to specify scopeMapId. */ + interface WithScopeMapId { + /** + * Specifies the scopeMapId property: The resource ID of the scope map to which the token will be associated + * with.. + * + * @param scopeMapId The resource ID of the scope map to which the token will be associated with. + * @return the next definition stage. + */ + Update withScopeMapId(String scopeMapId); + } + /** The stage of the Token update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The status of the token example enabled or disabled.. + * + * @param status The status of the token example enabled or disabled. + * @return the next definition stage. + */ + Update withStatus(TokenStatus status); + } + /** The stage of the Token update allowing to specify credentials. */ + interface WithCredentials { + /** + * Specifies the credentials property: The credentials that can be used for authenticating the token.. + * + * @param credentials The credentials that can be used for authenticating the token. + * @return the next definition stage. + */ + Update withCredentials(TokenCredentialsProperties credentials); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Token refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Token refresh(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificate.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificate.java new file mode 100644 index 000000000000..617ff0a9a76e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificate.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The properties of a certificate used for authenticating a token. */ +@Fluent +public final class TokenCertificate { + /* + * The name property. + */ + @JsonProperty(value = "name") + private TokenCertificateName name; + + /* + * The expiry datetime of the certificate. + */ + @JsonProperty(value = "expiry") + private OffsetDateTime expiry; + + /* + * The thumbprint of the certificate. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /* + * Base 64 encoded string of the public certificate1 in PEM format that + * will be used for authenticating the token. + */ + @JsonProperty(value = "encodedPemCertificate") + private String encodedPemCertificate; + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public TokenCertificateName name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the TokenCertificate object itself. + */ + public TokenCertificate withName(TokenCertificateName name) { + this.name = name; + return this; + } + + /** + * Get the expiry property: The expiry datetime of the certificate. + * + * @return the expiry value. + */ + public OffsetDateTime expiry() { + return this.expiry; + } + + /** + * Set the expiry property: The expiry datetime of the certificate. + * + * @param expiry the expiry value to set. + * @return the TokenCertificate object itself. + */ + public TokenCertificate withExpiry(OffsetDateTime expiry) { + this.expiry = expiry; + return this; + } + + /** + * Get the thumbprint property: The thumbprint of the certificate. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: The thumbprint of the certificate. + * + * @param thumbprint the thumbprint value to set. + * @return the TokenCertificate object itself. + */ + public TokenCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the encodedPemCertificate property: Base 64 encoded string of the public certificate1 in PEM format that will + * be used for authenticating the token. + * + * @return the encodedPemCertificate value. + */ + public String encodedPemCertificate() { + return this.encodedPemCertificate; + } + + /** + * Set the encodedPemCertificate property: Base 64 encoded string of the public certificate1 in PEM format that will + * be used for authenticating the token. + * + * @param encodedPemCertificate the encodedPemCertificate value to set. + * @return the TokenCertificate object itself. + */ + public TokenCertificate withEncodedPemCertificate(String encodedPemCertificate) { + this.encodedPemCertificate = encodedPemCertificate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificateName.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificateName.java new file mode 100644 index 000000000000..e4cffd3f6904 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCertificateName.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TokenCertificateName. */ +public final class TokenCertificateName extends ExpandableStringEnum { + /** Static value certificate1 for TokenCertificateName. */ + public static final TokenCertificateName CERTIFICATE1 = fromString("certificate1"); + + /** Static value certificate2 for TokenCertificateName. */ + public static final TokenCertificateName CERTIFICATE2 = fromString("certificate2"); + + /** + * Creates or finds a TokenCertificateName from its string representation. + * + * @param name a name to look for. + * @return the corresponding TokenCertificateName. + */ + @JsonCreator + public static TokenCertificateName fromString(String name) { + return fromString(name, TokenCertificateName.class); + } + + /** @return known TokenCertificateName values. */ + public static Collection values() { + return values(TokenCertificateName.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCredentialsProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCredentialsProperties.java new file mode 100644 index 000000000000..c8ba59337c8e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenCredentialsProperties.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of the credentials that can be used for authenticating the token. */ +@Fluent +public final class TokenCredentialsProperties { + /* + * The certificates property. + */ + @JsonProperty(value = "certificates") + private List certificates; + + /* + * The passwords property. + */ + @JsonProperty(value = "passwords") + private List passwords; + + /** + * Get the certificates property: The certificates property. + * + * @return the certificates value. + */ + public List certificates() { + return this.certificates; + } + + /** + * Set the certificates property: The certificates property. + * + * @param certificates the certificates value to set. + * @return the TokenCredentialsProperties object itself. + */ + public TokenCredentialsProperties withCertificates(List certificates) { + this.certificates = certificates; + return this; + } + + /** + * Get the passwords property: The passwords property. + * + * @return the passwords value. + */ + public List passwords() { + return this.passwords; + } + + /** + * Set the passwords property: The passwords property. + * + * @param passwords the passwords value to set. + * @return the TokenCredentialsProperties object itself. + */ + public TokenCredentialsProperties withPasswords(List passwords) { + this.passwords = passwords; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificates() != null) { + certificates().forEach(e -> e.validate()); + } + if (passwords() != null) { + passwords().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenListResult.java new file mode 100644 index 000000000000..ec5d4b93d6dc --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenListResult.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TokenInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list tokens for a container registry. */ +@Fluent +public final class TokenListResult { + /* + * The list of tokens. Since this list may be incomplete, the nextLink + * field should be used to request the next list of tokens. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of tokens. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of tokens. Since this list may be incomplete, the nextLink field should be used + * to request the next list of tokens. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of tokens. Since this list may be incomplete, the nextLink field should be used + * to request the next list of tokens. + * + * @param value the value value to set. + * @return the TokenListResult object itself. + */ + public TokenListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of tokens. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of tokens. + * + * @param nextLink the nextLink value to set. + * @return the TokenListResult object itself. + */ + public TokenListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenPassword.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenPassword.java new file mode 100644 index 000000000000..1199a3a03de3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenPassword.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The password that will be used for authenticating the token of a container registry. */ +@Fluent +public final class TokenPassword { + /* + * The creation datetime of the password. + */ + @JsonProperty(value = "creationTime") + private OffsetDateTime creationTime; + + /* + * The expiry datetime of the password. + */ + @JsonProperty(value = "expiry") + private OffsetDateTime expiry; + + /* + * The password name "password1" or "password2" + */ + @JsonProperty(value = "name") + private TokenPasswordName name; + + /* + * The password value. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the creationTime property: The creation datetime of the password. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Set the creationTime property: The creation datetime of the password. + * + * @param creationTime the creationTime value to set. + * @return the TokenPassword object itself. + */ + public TokenPassword withCreationTime(OffsetDateTime creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Get the expiry property: The expiry datetime of the password. + * + * @return the expiry value. + */ + public OffsetDateTime expiry() { + return this.expiry; + } + + /** + * Set the expiry property: The expiry datetime of the password. + * + * @param expiry the expiry value to set. + * @return the TokenPassword object itself. + */ + public TokenPassword withExpiry(OffsetDateTime expiry) { + this.expiry = expiry; + return this; + } + + /** + * Get the name property: The password name "password1" or "password2". + * + * @return the name value. + */ + public TokenPasswordName name() { + return this.name; + } + + /** + * Set the name property: The password name "password1" or "password2". + * + * @param name the name value to set. + * @return the TokenPassword object itself. + */ + public TokenPassword withName(TokenPasswordName name) { + this.name = name; + return this; + } + + /** + * Get the value property: The password value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenPasswordName.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenPasswordName.java new file mode 100644 index 000000000000..890cdc3e545a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenPasswordName.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TokenPasswordName. */ +public final class TokenPasswordName extends ExpandableStringEnum { + /** Static value password1 for TokenPasswordName. */ + public static final TokenPasswordName PASSWORD1 = fromString("password1"); + + /** Static value password2 for TokenPasswordName. */ + public static final TokenPasswordName PASSWORD2 = fromString("password2"); + + /** + * Creates or finds a TokenPasswordName from its string representation. + * + * @param name a name to look for. + * @return the corresponding TokenPasswordName. + */ + @JsonCreator + public static TokenPasswordName fromString(String name) { + return fromString(name, TokenPasswordName.class); + } + + /** @return known TokenPasswordName values. */ + public static Collection values() { + return values(TokenPasswordName.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenStatus.java new file mode 100644 index 000000000000..4d53dd97b0a1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TokenStatus. */ +public final class TokenStatus extends ExpandableStringEnum { + /** Static value enabled for TokenStatus. */ + public static final TokenStatus ENABLED = fromString("enabled"); + + /** Static value disabled for TokenStatus. */ + public static final TokenStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a TokenStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TokenStatus. + */ + @JsonCreator + public static TokenStatus fromString(String name) { + return fromString(name, TokenStatus.class); + } + + /** @return known TokenStatus values. */ + public static Collection values() { + return values(TokenStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenUpdateParameters.java new file mode 100644 index 000000000000..eb0a68de92e8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TokenUpdateParameters.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.TokenUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters for updating a token. */ +@Fluent +public final class TokenUpdateParameters { + /* + * The properties of the token update parameters. + */ + @JsonProperty(value = "properties") + private TokenUpdateProperties innerProperties; + + /** + * Get the innerProperties property: The properties of the token update parameters. + * + * @return the innerProperties value. + */ + private TokenUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the scopeMapId property: The resource ID of the scope map to which the token will be associated with. + * + * @return the scopeMapId value. + */ + public String scopeMapId() { + return this.innerProperties() == null ? null : this.innerProperties().scopeMapId(); + } + + /** + * Set the scopeMapId property: The resource ID of the scope map to which the token will be associated with. + * + * @param scopeMapId the scopeMapId value to set. + * @return the TokenUpdateParameters object itself. + */ + public TokenUpdateParameters withScopeMapId(String scopeMapId) { + if (this.innerProperties() == null) { + this.innerProperties = new TokenUpdateProperties(); + } + this.innerProperties().withScopeMapId(scopeMapId); + return this; + } + + /** + * Get the status property: The status of the token example enabled or disabled. + * + * @return the status value. + */ + public TokenStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the token example enabled or disabled. + * + * @param status the status value to set. + * @return the TokenUpdateParameters object itself. + */ + public TokenUpdateParameters withStatus(TokenStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new TokenUpdateProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the credentials property: The credentials that can be used for authenticating the token. + * + * @return the credentials value. + */ + public TokenCredentialsProperties credentials() { + return this.innerProperties() == null ? null : this.innerProperties().credentials(); + } + + /** + * Set the credentials property: The credentials that can be used for authenticating the token. + * + * @param credentials the credentials value to set. + * @return the TokenUpdateParameters object itself. + */ + public TokenUpdateParameters withCredentials(TokenCredentialsProperties credentials) { + if (this.innerProperties() == null) { + this.innerProperties = new TokenUpdateProperties(); + } + this.innerProperties().withCredentials(credentials); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Tokens.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Tokens.java new file mode 100644 index 000000000000..c0edf9bfc17b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Tokens.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Tokens. */ +public interface Tokens { + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the tokens for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list tokens for a container registry as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token. + */ + Token get(String resourceGroupName, String registryName, String tokenName); + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String registryName, String tokenName, Context context); + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String tokenName); + + /** + * Deletes a token from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String tokenName, Context context); + + /** + * Gets the properties of the specified token. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token along with {@link Response}. + */ + Token getById(String id); + + /** + * Gets the properties of the specified token. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified token along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a token from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a token from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Token resource. + * + * @param name resource name. + * @return the first stage of the new Token definition. + */ + Token.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerStatus.java new file mode 100644 index 000000000000..a139ed9dd5b8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TriggerStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TriggerStatus. */ +public final class TriggerStatus extends ExpandableStringEnum { + /** Static value Enabled for TriggerStatus. */ + public static final TriggerStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for TriggerStatus. */ + public static final TriggerStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a TriggerStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TriggerStatus. + */ + @JsonCreator + public static TriggerStatus fromString(String name) { + return fromString(name, TriggerStatus.class); + } + + /** @return known TriggerStatus values. */ + public static Collection values() { + return values(TriggerStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TrustPolicy.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TrustPolicy.java new file mode 100644 index 000000000000..fa1bd37747a3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TrustPolicy.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The content trust policy for a container registry. */ +@Fluent +public final class TrustPolicy { + /* + * The type of trust policy. + */ + @JsonProperty(value = "type") + private TrustPolicyType type; + + /* + * The value that indicates whether the policy is enabled or not. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /** + * Get the type property: The type of trust policy. + * + * @return the type value. + */ + public TrustPolicyType type() { + return this.type; + } + + /** + * Set the type property: The type of trust policy. + * + * @param type the type value to set. + * @return the TrustPolicy object itself. + */ + public TrustPolicy withType(TrustPolicyType type) { + this.type = type; + return this; + } + + /** + * Get the status property: The value that indicates whether the policy is enabled or not. + * + * @return the status value. + */ + public PolicyStatus status() { + return this.status; + } + + /** + * Set the status property: The value that indicates whether the policy is enabled or not. + * + * @param status the status value to set. + * @return the TrustPolicy object itself. + */ + public TrustPolicy withStatus(PolicyStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TrustPolicyType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TrustPolicyType.java new file mode 100644 index 000000000000..2841bd29e8fa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/TrustPolicyType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TrustPolicyType. */ +public final class TrustPolicyType extends ExpandableStringEnum { + /** Static value Notary for TrustPolicyType. */ + public static final TrustPolicyType NOTARY = fromString("Notary"); + + /** + * Creates or finds a TrustPolicyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TrustPolicyType. + */ + @JsonCreator + public static TrustPolicyType fromString(String name) { + return fromString(name, TrustPolicyType.class); + } + + /** @return known TrustPolicyType values. */ + public static Collection values() { + return values(TrustPolicyType.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/UserIdentityProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/UserIdentityProperties.java new file mode 100644 index 000000000000..bd57ad944346 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/UserIdentityProperties.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties for user assigned identities. */ +@Fluent +public final class UserIdentityProperties { + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal id of user assigned identity. + * + * @param principalId the principalId value to set. + * @return the UserIdentityProperties object itself. + */ + public UserIdentityProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The client id of user assigned identity. + * + * @param clientId the clientId value to set. + * @return the UserIdentityProperties object itself. + */ + public UserIdentityProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhook.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhook.java new file mode 100644 index 000000000000..469358cc94b8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhook.java @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of Webhook. */ +public interface Webhook { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the status property: The status of the webhook at the time the operation was called. + * + * @return the status value. + */ + WebhookStatus status(); + + /** + * Gets the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + * 'foo:latest'. Empty means all events. + * + * @return the scope value. + */ + String scope(); + + /** + * Gets the actions property: The list of actions that trigger the webhook to post notifications. + * + * @return the actions value. + */ + List actions(); + + /** + * Gets the provisioningState property: The provisioning state of the webhook at the time the operation was called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookInner object. + * + * @return the inner object. + */ + WebhookInner innerModel(); + + /** The entirety of the Webhook definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The Webhook definition stages. */ + interface DefinitionStages { + /** The first stage of the Webhook definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Webhook definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location of the webhook. This cannot be changed after the resource is created. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location of the webhook. This cannot be changed after the resource is created. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Webhook definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, registryName. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @return the next definition stage. + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + /** + * The stage of the Webhook definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithServiceUri, + DefinitionStages.WithCustomHeaders, + DefinitionStages.WithStatus, + DefinitionStages.WithScope, + DefinitionStages.WithActions { + /** + * Executes the create request. + * + * @return the created resource. + */ + Webhook create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Webhook create(Context context); + } + /** The stage of the Webhook definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags for the webhook.. + * + * @param tags The tags for the webhook. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Webhook definition allowing to specify serviceUri. */ + interface WithServiceUri { + /** + * Specifies the serviceUri property: The service URI for the webhook to post notifications.. + * + * @param serviceUri The service URI for the webhook to post notifications. + * @return the next definition stage. + */ + WithCreate withServiceUri(String serviceUri); + } + /** The stage of the Webhook definition allowing to specify customHeaders. */ + interface WithCustomHeaders { + /** + * Specifies the customHeaders property: Custom headers that will be added to the webhook notifications.. + * + * @param customHeaders Custom headers that will be added to the webhook notifications. + * @return the next definition stage. + */ + WithCreate withCustomHeaders(Map customHeaders); + } + /** The stage of the Webhook definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The status of the webhook at the time the operation was called.. + * + * @param status The status of the webhook at the time the operation was called. + * @return the next definition stage. + */ + WithCreate withStatus(WebhookStatus status); + } + /** The stage of the Webhook definition allowing to specify scope. */ + interface WithScope { + /** + * Specifies the scope property: The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. + * 'foo' is equivalent to 'foo:latest'. Empty means all events.. + * + * @param scope The scope of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is + * equivalent to 'foo:latest'. Empty means all events. + * @return the next definition stage. + */ + WithCreate withScope(String scope); + } + /** The stage of the Webhook definition allowing to specify actions. */ + interface WithActions { + /** + * Specifies the actions property: The list of actions that trigger the webhook to post notifications.. + * + * @param actions The list of actions that trigger the webhook to post notifications. + * @return the next definition stage. + */ + WithCreate withActions(List actions); + } + } + /** + * Begins update for the Webhook resource. + * + * @return the stage of resource update. + */ + Webhook.Update update(); + + /** The template for Webhook update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithServiceUri, + UpdateStages.WithCustomHeaders, + UpdateStages.WithStatus, + UpdateStages.WithScope, + UpdateStages.WithActions { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Webhook apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Webhook apply(Context context); + } + /** The Webhook update stages. */ + interface UpdateStages { + /** The stage of the Webhook update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags for the webhook.. + * + * @param tags The tags for the webhook. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Webhook update allowing to specify serviceUri. */ + interface WithServiceUri { + /** + * Specifies the serviceUri property: The service URI for the webhook to post notifications.. + * + * @param serviceUri The service URI for the webhook to post notifications. + * @return the next definition stage. + */ + Update withServiceUri(String serviceUri); + } + /** The stage of the Webhook update allowing to specify customHeaders. */ + interface WithCustomHeaders { + /** + * Specifies the customHeaders property: Custom headers that will be added to the webhook notifications.. + * + * @param customHeaders Custom headers that will be added to the webhook notifications. + * @return the next definition stage. + */ + Update withCustomHeaders(Map customHeaders); + } + /** The stage of the Webhook update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The status of the webhook at the time the operation was called.. + * + * @param status The status of the webhook at the time the operation was called. + * @return the next definition stage. + */ + Update withStatus(WebhookStatus status); + } + /** The stage of the Webhook update allowing to specify scope. */ + interface WithScope { + /** + * Specifies the scope property: The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. + * 'foo' is equivalent to 'foo:latest'. Empty means all events.. + * + * @param scope The scope of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is + * equivalent to 'foo:latest'. Empty means all events. + * @return the next definition stage. + */ + Update withScope(String scope); + } + /** The stage of the Webhook update allowing to specify actions. */ + interface WithActions { + /** + * Specifies the actions property: The list of actions that trigger the webhook to post notifications.. + * + * @param actions The list of actions that trigger the webhook to post notifications. + * @return the next definition stage. + */ + Update withActions(List actions); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Webhook refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Webhook refresh(Context context); + + /** + * Triggers a ping event to be sent to the webhook. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event. + */ + EventInfo ping(); + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event along with {@link Response}. + */ + Response pingWithResponse(Context context); + + /** + * Lists recent events for the specified webhook. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook as paginated response with {@link PagedIterable}. + */ + PagedIterable listEvents(); + + /** + * Lists recent events for the specified webhook. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook as paginated response with {@link PagedIterable}. + */ + PagedIterable listEvents(Context context); + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook. + */ + CallbackConfig getCallbackConfig(); + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook along with {@link Response}. + */ + Response getCallbackConfigWithResponse(Context context); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookAction.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookAction.java new file mode 100644 index 000000000000..19109861200e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookAction.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebhookAction. */ +public final class WebhookAction extends ExpandableStringEnum { + /** Static value push for WebhookAction. */ + public static final WebhookAction PUSH = fromString("push"); + + /** Static value delete for WebhookAction. */ + public static final WebhookAction DELETE = fromString("delete"); + + /** Static value quarantine for WebhookAction. */ + public static final WebhookAction QUARANTINE = fromString("quarantine"); + + /** Static value chart_push for WebhookAction. */ + public static final WebhookAction CHART_PUSH = fromString("chart_push"); + + /** Static value chart_delete for WebhookAction. */ + public static final WebhookAction CHART_DELETE = fromString("chart_delete"); + + /** + * Creates or finds a WebhookAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebhookAction. + */ + @JsonCreator + public static WebhookAction fromString(String name) { + return fromString(name, WebhookAction.class); + } + + /** @return known WebhookAction values. */ + public static Collection values() { + return values(WebhookAction.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookCreateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookCreateParameters.java new file mode 100644 index 000000000000..9e3a4acbbce7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookCreateParameters.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookPropertiesCreateParameters; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The parameters for creating a webhook. */ +@Fluent +public final class WebhookCreateParameters { + /* + * The tags for the webhook. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The location of the webhook. This cannot be changed after the resource + * is created. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * The properties that the webhook will be created with. + */ + @JsonProperty(value = "properties") + private WebhookPropertiesCreateParameters innerProperties; + + /** + * Get the tags property: The tags for the webhook. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags for the webhook. + * + * @param tags the tags value to set. + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The location of the webhook. This cannot be changed after the resource is created. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the webhook. This cannot be changed after the resource is created. + * + * @param location the location value to set. + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the innerProperties property: The properties that the webhook will be created with. + * + * @return the innerProperties value. + */ + private WebhookPropertiesCreateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the serviceUri property: The service URI for the webhook to post notifications. + * + * @return the serviceUri value. + */ + public String serviceUri() { + return this.innerProperties() == null ? null : this.innerProperties().serviceUri(); + } + + /** + * Set the serviceUri property: The service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set. + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withServiceUri(String serviceUri) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesCreateParameters(); + } + this.innerProperties().withServiceUri(serviceUri); + return this; + } + + /** + * Get the customHeaders property: Custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value. + */ + public Map customHeaders() { + return this.innerProperties() == null ? null : this.innerProperties().customHeaders(); + } + + /** + * Set the customHeaders property: Custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set. + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withCustomHeaders(Map customHeaders) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesCreateParameters(); + } + this.innerProperties().withCustomHeaders(customHeaders); + return this; + } + + /** + * Get the status property: The status of the webhook at the time the operation was called. + * + * @return the status value. + */ + public WebhookStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the webhook at the time the operation was called. + * + * @param status the status value to set. + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withStatus(WebhookStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesCreateParameters(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + * 'foo:latest'. Empty means all events. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + * 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set. + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withScope(String scope) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesCreateParameters(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the actions property: The list of actions that trigger the webhook to post notifications. + * + * @return the actions value. + */ + public List actions() { + return this.innerProperties() == null ? null : this.innerProperties().actions(); + } + + /** + * Set the actions property: The list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set. + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withActions(List actions) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesCreateParameters(); + } + this.innerProperties().withActions(actions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property location in model WebhookCreateParameters")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebhookCreateParameters.class); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookListResult.java new file mode 100644 index 000000000000..c5b5f2f1c8bf --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookListResult.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The result of a request to list webhooks for a container registry. */ +@Fluent +public final class WebhookListResult { + /* + * The list of webhooks. Since this list may be incomplete, the nextLink + * field should be used to request the next list of webhooks. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URI that can be used to request the next list of webhooks. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of webhooks. Since this list may be incomplete, the nextLink field should be + * used to request the next list of webhooks. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of webhooks. Since this list may be incomplete, the nextLink field should be + * used to request the next list of webhooks. + * + * @param value the value value to set. + * @return the WebhookListResult object itself. + */ + public WebhookListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URI that can be used to request the next list of webhooks. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URI that can be used to request the next list of webhooks. + * + * @param nextLink the nextLink value to set. + * @return the WebhookListResult object itself. + */ + public WebhookListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookStatus.java new file mode 100644 index 000000000000..05943ccff283 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WebhookStatus. */ +public final class WebhookStatus extends ExpandableStringEnum { + /** Static value enabled for WebhookStatus. */ + public static final WebhookStatus ENABLED = fromString("enabled"); + + /** Static value disabled for WebhookStatus. */ + public static final WebhookStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a WebhookStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding WebhookStatus. + */ + @JsonCreator + public static WebhookStatus fromString(String name) { + return fromString(name, WebhookStatus.class); + } + + /** @return known WebhookStatus values. */ + public static Collection values() { + return values(WebhookStatus.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookUpdateParameters.java new file mode 100644 index 000000000000..0fdf59d89db4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/WebhookUpdateParameters.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerregistry.generated.fluent.models.WebhookPropertiesUpdateParameters; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The parameters for updating a webhook. */ +@Fluent +public final class WebhookUpdateParameters { + /* + * The tags for the webhook. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The properties that the webhook will be updated with. + */ + @JsonProperty(value = "properties") + private WebhookPropertiesUpdateParameters innerProperties; + + /** + * Get the tags property: The tags for the webhook. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags for the webhook. + * + * @param tags the tags value to set. + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the innerProperties property: The properties that the webhook will be updated with. + * + * @return the innerProperties value. + */ + private WebhookPropertiesUpdateParameters innerProperties() { + return this.innerProperties; + } + + /** + * Get the serviceUri property: The service URI for the webhook to post notifications. + * + * @return the serviceUri value. + */ + public String serviceUri() { + return this.innerProperties() == null ? null : this.innerProperties().serviceUri(); + } + + /** + * Set the serviceUri property: The service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set. + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withServiceUri(String serviceUri) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesUpdateParameters(); + } + this.innerProperties().withServiceUri(serviceUri); + return this; + } + + /** + * Get the customHeaders property: Custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value. + */ + public Map customHeaders() { + return this.innerProperties() == null ? null : this.innerProperties().customHeaders(); + } + + /** + * Set the customHeaders property: Custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set. + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withCustomHeaders(Map customHeaders) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesUpdateParameters(); + } + this.innerProperties().withCustomHeaders(customHeaders); + return this; + } + + /** + * Get the status property: The status of the webhook at the time the operation was called. + * + * @return the status value. + */ + public WebhookStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: The status of the webhook at the time the operation was called. + * + * @param status the status value to set. + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withStatus(WebhookStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesUpdateParameters(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + * 'foo:latest'. Empty means all events. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: The scope of repositories where the event can be triggered. For example, 'foo:*' means + * events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to + * 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set. + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withScope(String scope) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesUpdateParameters(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the actions property: The list of actions that trigger the webhook to post notifications. + * + * @return the actions value. + */ + public List actions() { + return this.innerProperties() == null ? null : this.innerProperties().actions(); + } + + /** + * Set the actions property: The list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set. + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withActions(List actions) { + if (this.innerProperties() == null) { + this.innerProperties = new WebhookPropertiesUpdateParameters(); + } + this.innerProperties().withActions(actions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhooks.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhooks.java new file mode 100644 index 000000000000..eb2dbfd4efc9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/Webhooks.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Webhooks. */ +public interface Webhooks { + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list webhooks for a container registry as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String registryName, Context context); + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook. + */ + Webhook get(String resourceGroupName, String registryName, String webhookName); + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String webhookName); + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event. + */ + EventInfo ping(String resourceGroupName, String registryName, String webhookName); + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the basic information of an event along with {@link Response}. + */ + Response pingWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook as paginated response with {@link PagedIterable}. + */ + PagedIterable listEvents(String resourceGroupName, String registryName, String webhookName); + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a request to list events for a webhook as paginated response with {@link PagedIterable}. + */ + PagedIterable listEvents(String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook. + */ + CallbackConfig getCallbackConfig(String resourceGroupName, String registryName, String webhookName); + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration of service URI and custom headers for the webhook along with {@link Response}. + */ + Response getCallbackConfigWithResponse( + String resourceGroupName, String registryName, String webhookName, Context context); + + /** + * Gets the properties of the specified webhook. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook along with {@link Response}. + */ + Webhook getById(String id); + + /** + * Gets the properties of the specified webhook. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of the specified webhook along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a webhook from a container registry. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a webhook from a container registry. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Webhook resource. + * + * @param name resource name. + * @return the first stage of the new Webhook definition. + */ + Webhook.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ZoneRedundancy.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ZoneRedundancy.java new file mode 100644 index 000000000000..8e88e41e6b02 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/ZoneRedundancy.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ZoneRedundancy. */ +public final class ZoneRedundancy extends ExpandableStringEnum { + /** Static value Enabled for ZoneRedundancy. */ + public static final ZoneRedundancy ENABLED = fromString("Enabled"); + + /** Static value Disabled for ZoneRedundancy. */ + public static final ZoneRedundancy DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ZoneRedundancy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ZoneRedundancy. + */ + @JsonCreator + public static ZoneRedundancy fromString(String name) { + return fromString(name, ZoneRedundancy.class); + } + + /** @return known ZoneRedundancy values. */ + public static Collection values() { + return values(ZoneRedundancy.class); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/package-info.java new file mode 100644 index 000000000000..f8099cab9d16 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for ContainerRegistryManagementClient. null. */ +package com.azure.resourcemanager.containerregistry.generated.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/package-info.java new file mode 100644 index 000000000000..abf9e0c82013 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/com/azure/resourcemanager/containerregistry/generated/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for ContainerRegistryManagementClient. null. */ +package com.azure.resourcemanager.containerregistry.generated; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/module-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/module-info.java new file mode 100644 index 000000000000..929aeabe28fa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.containerregistry.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.containerregistry.generated; + exports com.azure.resourcemanager.containerregistry.generated.fluent; + exports com.azure.resourcemanager.containerregistry.generated.fluent.models; + exports com.azure.resourcemanager.containerregistry.generated.models; + + opens com.azure.resourcemanager.containerregistry.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.containerregistry.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesCreateSamples.java new file mode 100644 index 000000000000..01fd33bdfb7b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesCreateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistryMode; +import com.azure.resourcemanager.containerregistry.generated.models.ParentProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SyncProperties; +import java.time.Duration; +import java.util.Arrays; + +/** Samples for ConnectedRegistries Create. */ +public final class ConnectedRegistriesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ConnectedRegistryCreate.json + */ + /** + * Sample code: ConnectedRegistryCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .connectedRegistries() + .define("myConnectedRegistry") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withMode(ConnectedRegistryMode.READ_WRITE) + .withParent( + new ParentProperties() + .withSyncProperties( + new SyncProperties() + .withTokenId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/syncToken") + .withSchedule("0 9 * * *") + .withSyncWindow(Duration.parse("PT3H")) + .withMessageTtl(Duration.parse("P2D")))) + .withClientTokenIds( + Arrays + .asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token")) + .withNotificationsList(Arrays.asList("hello-world:*:*", "sample/repo/*:1.0:*")) + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesDeactivateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesDeactivateSamples.java new file mode 100644 index 000000000000..10b43dc052cd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesDeactivateSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ConnectedRegistries Deactivate. */ +public final class ConnectedRegistriesDeactivateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ConnectedRegistryDeactivate.json + */ + /** + * Sample code: ConnectedRegistryDeactivate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryDeactivate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.connectedRegistries().deactivate("myResourceGroup", "myRegistry", "myConnectedRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesDeleteSamples.java new file mode 100644 index 000000000000..4c5bd2f42da8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ConnectedRegistries Delete. */ +public final class ConnectedRegistriesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ConnectedRegistryDelete.json + */ + /** + * Sample code: ConnectedRegistryDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.connectedRegistries().delete("myResourceGroup", "myRegistry", "myConnectedRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesGetSamples.java new file mode 100644 index 000000000000..06ed5b1ac658 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ConnectedRegistries Get. */ +public final class ConnectedRegistriesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ConnectedRegistryGet.json + */ + /** + * Sample code: ConnectedRegistryGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .connectedRegistries() + .getWithResponse("myResourceGroup", "myRegistry", "myConnectedRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesListSamples.java new file mode 100644 index 000000000000..54e046a826aa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ConnectedRegistries List. */ +public final class ConnectedRegistriesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ConnectedRegistryList.json + */ + /** + * Sample code: ConnectedRegistryList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.connectedRegistries().list("myResourceGroup", "myRegistry", null, Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesUpdateSamples.java new file mode 100644 index 000000000000..4e1db0fc16bb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ConnectedRegistriesUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.AuditLogStatus; +import com.azure.resourcemanager.containerregistry.generated.models.ConnectedRegistry; +import com.azure.resourcemanager.containerregistry.generated.models.LogLevel; +import com.azure.resourcemanager.containerregistry.generated.models.LoggingProperties; +import com.azure.resourcemanager.containerregistry.generated.models.SyncUpdateProperties; +import java.time.Duration; +import java.util.Arrays; + +/** Samples for ConnectedRegistries Update. */ +public final class ConnectedRegistriesUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ConnectedRegistryUpdate.json + */ + /** + * Sample code: ConnectedRegistryUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void connectedRegistryUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + ConnectedRegistry resource = + manager + .connectedRegistries() + .getWithResponse("myResourceGroup", "myRegistry", "myScopeMap", Context.NONE) + .getValue(); + resource + .update() + .withSyncProperties( + new SyncUpdateProperties() + .withSchedule("0 0 */10 * *") + .withSyncWindow(Duration.parse("P2D")) + .withMessageTtl(Duration.parse("P30D"))) + .withLogging( + new LoggingProperties().withLogLevel(LogLevel.DEBUG).withAuditLogStatus(AuditLogStatus.ENABLED)) + .withClientTokenIds( + Arrays + .asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client1Token", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/client2Token")) + .withNotificationsList(Arrays.asList("hello-world:*:*", "sample/repo/*:1.0:*")) + .apply(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesCreateSamples.java new file mode 100644 index 000000000000..a298685303fe --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesCreateSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.ExportPipelineTargetProperties; +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineOptions; +import com.azure.resourcemanager.containerregistry.generated.models.ResourceIdentityType; +import java.util.Arrays; + +/** Samples for ExportPipelines Create. */ +public final class ExportPipelinesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ExportPipelineCreate.json + */ + /** + * Sample code: ExportPipelineCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .exportPipelines() + .define("myExportPipeline") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRegion("westus") + .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withTarget( + new ExportPipelineTargetProperties() + .withType("AzureStorageBlobContainer") + .withUri("https://accountname.blob.core.windows.net/containername") + .withKeyVaultUri("https://myvault.vault.azure.net/secrets/acrexportsas")) + .withOptions(Arrays.asList(PipelineOptions.OVERWRITE_BLOBS)) + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesDeleteSamples.java new file mode 100644 index 000000000000..9540978b3f6e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ExportPipelines Delete. */ +public final class ExportPipelinesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ExportPipelineDelete.json + */ + /** + * Sample code: ExportPipelineDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.exportPipelines().delete("myResourceGroup", "myRegistry", "myExportPipeline", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesGetSamples.java new file mode 100644 index 000000000000..fdde00c0edb8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ExportPipelines Get. */ +public final class ExportPipelinesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ExportPipelineGet.json + */ + /** + * Sample code: ExportPipelineGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.exportPipelines().getWithResponse("myResourceGroup", "myRegistry", "myExportPipeline", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesListSamples.java new file mode 100644 index 000000000000..0952a89c2377 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ExportPipelinesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ExportPipelines List. */ +public final class ExportPipelinesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ExportPipelineList.json + */ + /** + * Sample code: ExportPipelineList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void exportPipelineList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.exportPipelines().list("myResourceGroup", "myRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesCreateSamples.java new file mode 100644 index 000000000000..0dc2c7c40ede --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesCreateSamples.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.IdentityProperties; +import com.azure.resourcemanager.containerregistry.generated.models.ImportPipelineSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineOptions; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineSourceType; +import com.azure.resourcemanager.containerregistry.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.containerregistry.generated.models.UserIdentityProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ImportPipelines Create. */ +public final class ImportPipelinesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ImportPipelineCreate.json + */ + /** + * Sample code: ImportPipelineCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .importPipelines() + .define("myImportPipeline") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRegion("westus") + .withIdentity( + new IdentityProperties() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", + new UserIdentityProperties()))) + .withSource( + new ImportPipelineSourceProperties() + .withType(PipelineSourceType.AZURE_STORAGE_BLOB_CONTAINER) + .withUri("https://accountname.blob.core.windows.net/containername") + .withKeyVaultUri("https://myvault.vault.azure.net/secrets/acrimportsas")) + .withOptions( + Arrays + .asList( + PipelineOptions.OVERWRITE_TAGS, + PipelineOptions.DELETE_SOURCE_BLOB_ON_SUCCESS, + PipelineOptions.CONTINUE_ON_ERRORS)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesDeleteSamples.java new file mode 100644 index 000000000000..d44b199153f7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ImportPipelines Delete. */ +public final class ImportPipelinesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ImportPipelineDelete.json + */ + /** + * Sample code: ImportPipelineDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.importPipelines().delete("myResourceGroup", "myRegistry", "myImportPipeline", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesGetSamples.java new file mode 100644 index 000000000000..038190167a06 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ImportPipelines Get. */ +public final class ImportPipelinesGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ImportPipelineGet.json + */ + /** + * Sample code: ImportPipelineGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.importPipelines().getWithResponse("myResourceGroup", "myRegistry", "myImportPipeline", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesListSamples.java new file mode 100644 index 000000000000..54edc08c94fa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ImportPipelinesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ImportPipelines List. */ +public final class ImportPipelinesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ImportPipelineList.json + */ + /** + * Sample code: ImportPipelineList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importPipelineList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.importPipelines().list("myResourceGroup", "myRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/OperationsListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/OperationsListSamples.java new file mode 100644 index 000000000000..784848612aa7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/OperationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/OperationList.json + */ + /** + * Sample code: OperationList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void operationList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsCreateSamples.java new file mode 100644 index 000000000000..537c15b2ec00 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsCreateSamples.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunRequest; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunSourceProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunSourceType; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunTargetProperties; +import com.azure.resourcemanager.containerregistry.generated.models.PipelineRunTargetType; +import java.util.Arrays; + +/** Samples for PipelineRuns Create. */ +public final class PipelineRunsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PipelineRunCreate_Import.json + */ + /** + * Sample code: PipelineRunCreate_Import. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunCreateImport( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .pipelineRuns() + .define("myPipelineRun") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRequest( + new PipelineRunRequest() + .withPipelineResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importPipelines/myImportPipeline") + .withSource( + new PipelineRunSourceProperties() + .withType(PipelineRunSourceType.AZURE_STORAGE_BLOB) + .withName("myblob.tar.gz")) + .withCatalogDigest("sha256@")) + .withForceUpdateTag("2020-03-04T17:23:21.9261521+00:00") + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PipelineRunCreate_Export.json + */ + /** + * Sample code: PipelineRunCreate_Export. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunCreateExport( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .pipelineRuns() + .define("myPipelineRun") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withRequest( + new PipelineRunRequest() + .withPipelineResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/exportPipelines/myExportPipeline") + .withArtifacts( + Arrays + .asList( + "sourceRepository/hello-world", + "sourceRepository2@sha256:00000000000000000000000000000000000")) + .withTarget( + new PipelineRunTargetProperties() + .withType(PipelineRunTargetType.AZURE_STORAGE_BLOB) + .withName("myblob.tar.gz"))) + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsDeleteSamples.java new file mode 100644 index 000000000000..43bd520866e1 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PipelineRuns Delete. */ +public final class PipelineRunsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PipelineRunDelete.json + */ + /** + * Sample code: PipelineRunDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.pipelineRuns().delete("myResourceGroup", "myRegistry", "myPipelineRun", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsGetSamples.java new file mode 100644 index 000000000000..5a9f0ebe80e4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PipelineRuns Get. */ +public final class PipelineRunsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PipelineRunGet.json + */ + /** + * Sample code: PipelineRunGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.pipelineRuns().getWithResponse("myResourceGroup", "myRegistry", "myPipelineRun", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsListSamples.java new file mode 100644 index 000000000000..a6d78037dcc6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PipelineRunsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PipelineRuns List. */ +public final class PipelineRunsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PipelineRunList.json + */ + /** + * Sample code: PipelineRunList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void pipelineRunList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.pipelineRuns().list("myResourceGroup", "myRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..2b26a6c34ee4 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.ConnectionStatus; +import com.azure.resourcemanager.containerregistry.generated.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PrivateEndpointConnectionCreateOrUpdate.json + */ + /** + * Sample code: PrivateEndpointConnectionCreateOrUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionCreateOrUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .privateEndpointConnections() + .define("myConnection") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(ConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..3cb8491856ab --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PrivateEndpointConnectionDelete.json + */ + /** + * Sample code: PrivateEndpointConnectionDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.privateEndpointConnections().delete("myResourceGroup", "myRegistry", "myConnection", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..bbb32649ba45 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PrivateEndpointConnectionGet.json + */ + /** + * Sample code: PrivateEndpointConnectionGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("myResourceGroup", "myRegistry", "myConnection", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 000000000000..e3c9d0979c84 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/PrivateEndpointConnectionList.json + */ + /** + * Sample code: PrivateEndpointConnectionList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void privateEndpointConnectionList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.privateEndpointConnections().list("myResourceGroup", "myRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesCheckNameAvailabilitySamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesCheckNameAvailabilitySamples.java new file mode 100644 index 000000000000..35a11617030b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesCheckNameAvailabilitySamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.RegistryNameCheckRequest; + +/** Samples for Registries CheckNameAvailability. */ +public final class RegistriesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryCheckNameAvailable.json + */ + /** + * Sample code: RegistryCheckNameAvailable. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCheckNameAvailable( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .checkNameAvailabilityWithResponse(new RegistryNameCheckRequest().withName("myRegistry"), Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryCheckNameNotAvailable.json + */ + /** + * Sample code: RegistryCheckNameNotAvailable. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCheckNameNotAvailable( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .checkNameAvailabilityWithResponse(new RegistryNameCheckRequest().withName("myRegistry"), Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesCreateSamples.java new file mode 100644 index 000000000000..4ad9ad32fb64 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesCreateSamples.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.Sku; +import com.azure.resourcemanager.containerregistry.generated.models.SkuName; +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries Create. */ +public final class RegistriesCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryCreateZoneRedundant.json + */ + /** + * Sample code: RegistryCreateZoneRedundant. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCreateZoneRedundant( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .define("myRegistry") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName(SkuName.STANDARD)) + .withTags(mapOf("key", "value")) + .withZoneRedundancy(ZoneRedundancy.ENABLED) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryCreate.json + */ + /** + * Sample code: RegistryCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .define("myRegistry") + .withRegion("westus") + .withExistingResourceGroup("myResourceGroup") + .withSku(new Sku().withName(SkuName.STANDARD)) + .withTags(mapOf("key", "value")) + .withAdminUserEnabled(true) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesDeleteSamples.java new file mode 100644 index 000000000000..54fecf0b238a --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Registries Delete. */ +public final class RegistriesDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryDelete.json + */ + /** + * Sample code: RegistryDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().delete("myResourceGroup", "myRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGenerateCredentialsSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGenerateCredentialsSamples.java new file mode 100644 index 000000000000..9ee38656b3e9 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGenerateCredentialsSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.GenerateCredentialsParameters; +import java.time.OffsetDateTime; + +/** Samples for Registries GenerateCredentials. */ +public final class RegistriesGenerateCredentialsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryGenerateCredentials.json + */ + /** + * Sample code: RegistryGenerateCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryGenerateCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .generateCredentials( + "myResourceGroup", + "myRegistry", + new GenerateCredentialsParameters() + .withTokenId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken") + .withExpiry(OffsetDateTime.parse("2020-12-31T15:59:59.0707808Z")), + Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetByResourceGroupSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..3af800a3d4f0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Registries GetByResourceGroup. */ +public final class RegistriesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryGet.json + */ + /** + * Sample code: RegistryGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().getByResourceGroupWithResponse("myResourceGroup", "myRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetPrivateLinkResourceSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetPrivateLinkResourceSamples.java new file mode 100644 index 000000000000..2dc8900a93b7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesGetPrivateLinkResourceSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Registries GetPrivateLinkResource. */ +public final class RegistriesGetPrivateLinkResourceSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryGetPrivateLinkResource.json + */ + /** + * Sample code: RegistryGetPrivateLinkResource. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryGetPrivateLinkResource( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .getPrivateLinkResourceWithResponse("myResourceGroup", "myRegistry", "registry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesImportImageSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesImportImageSamples.java new file mode 100644 index 000000000000..081cc7d81bfd --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesImportImageSamples.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.ImportImageParameters; +import com.azure.resourcemanager.containerregistry.generated.models.ImportMode; +import com.azure.resourcemanager.containerregistry.generated.models.ImportSource; +import java.util.Arrays; + +/** Samples for Registries ImportImage. */ +public final class RegistriesImportImageSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ImportImageFromPublicRegistry.json + */ + /** + * Sample code: ImportImageFromPublicRegistry. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importImageFromPublicRegistry( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .importImage( + "myResourceGroup", + "myRegistry", + new ImportImageParameters() + .withSource( + new ImportSource() + .withRegistryUri("registry.hub.docker.com") + .withSourceImage("library/hello-world")) + .withTargetTags(Arrays.asList("targetRepository:targetTag")) + .withUntaggedTargetRepositories(Arrays.asList("targetRepository1")) + .withMode(ImportMode.FORCE), + Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ImportImageByTag.json + */ + /** + * Sample code: ImportImageByTag. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importImageByTag( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .importImage( + "myResourceGroup", + "myRegistry", + new ImportImageParameters() + .withSource( + new ImportSource() + .withResourceId( + "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry") + .withSourceImage("sourceRepository:sourceTag")) + .withTargetTags(Arrays.asList("targetRepository:targetTag")) + .withUntaggedTargetRepositories(Arrays.asList("targetRepository1")) + .withMode(ImportMode.FORCE), + Context.NONE); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ImportImageByManifestDigest.json + */ + /** + * Sample code: ImportImageByManifestDigest. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void importImageByManifestDigest( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .importImage( + "myResourceGroup", + "myRegistry", + new ImportImageParameters() + .withSource( + new ImportSource() + .withResourceId( + "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry") + .withSourceImage( + "sourceRepository@sha256:0000000000000000000000000000000000000000000000000000000000000000")) + .withTargetTags(Arrays.asList("targetRepository:targetTag")) + .withUntaggedTargetRepositories(Arrays.asList("targetRepository1")) + .withMode(ImportMode.FORCE), + Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListByResourceGroupSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListByResourceGroupSamples.java new file mode 100644 index 000000000000..e48338a49ad8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Registries ListByResourceGroup. */ +public final class RegistriesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryListByResourceGroup.json + */ + /** + * Sample code: RegistryListByResourceGroup. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListByResourceGroup( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().listByResourceGroup("myResourceGroup", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListCredentialsSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListCredentialsSamples.java new file mode 100644 index 000000000000..033d3e6548ab --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListCredentialsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Registries ListCredentials. */ +public final class RegistriesListCredentialsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryListCredentials.json + */ + /** + * Sample code: RegistryListCredentials. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListCredentials( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().listCredentialsWithResponse("myResourceGroup", "myRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListPrivateLinkResourcesSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListPrivateLinkResourcesSamples.java new file mode 100644 index 000000000000..3836bb905af3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListPrivateLinkResourcesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Registries ListPrivateLinkResources. */ +public final class RegistriesListPrivateLinkResourcesSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryListPrivateLinkResources.json + */ + /** + * Sample code: RegistryListPrivateLinkResources. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListPrivateLinkResources( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().listPrivateLinkResources("myResourceGroup", "myRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListSamples.java new file mode 100644 index 000000000000..da25fe9a0ed3 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Registries List. */ +public final class RegistriesListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryList.json + */ + /** + * Sample code: RegistryList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().list(Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListUsagesSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListUsagesSamples.java new file mode 100644 index 000000000000..40749bc4322c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesListUsagesSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Registries ListUsages. */ +public final class RegistriesListUsagesSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryListUsages.json + */ + /** + * Sample code: RegistryListUsages. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryListUsages( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.registries().listUsagesWithResponse("myResourceGroup", "myRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesRegenerateCredentialSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesRegenerateCredentialSamples.java new file mode 100644 index 000000000000..8a3899facb6c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesRegenerateCredentialSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.PasswordName; +import com.azure.resourcemanager.containerregistry.generated.models.RegenerateCredentialParameters; + +/** Samples for Registries RegenerateCredential. */ +public final class RegistriesRegenerateCredentialSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryRegenerateCredential.json + */ + /** + * Sample code: RegistryRegenerateCredential. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryRegenerateCredential( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .registries() + .regenerateCredentialWithResponse( + "myResourceGroup", + "myRegistry", + new RegenerateCredentialParameters().withName(PasswordName.PASSWORD), + Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesUpdateSamples.java new file mode 100644 index 000000000000..1f4744fbfa8f --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/RegistriesUpdateSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.Registry; +import com.azure.resourcemanager.containerregistry.generated.models.Sku; +import com.azure.resourcemanager.containerregistry.generated.models.SkuName; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Registries Update. */ +public final class RegistriesUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/RegistryUpdate.json + */ + /** + * Sample code: RegistryUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void registryUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Registry resource = + manager + .registries() + .getByResourceGroupWithResponse("myResourceGroup", "myRegistry", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key", "value")) + .withSku(new Sku().withName(SkuName.STANDARD)) + .withAdminUserEnabled(true) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsCreateSamples.java new file mode 100644 index 000000000000..408a4fba2a29 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsCreateSamples.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.ZoneRedundancy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Replications Create. */ +public final class ReplicationsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ReplicationCreate.json + */ + /** + * Sample code: ReplicationCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .replications() + .define("myReplication") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("key", "value")) + .create(); + } + + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ReplicationCreateZoneRedundant.json + */ + /** + * Sample code: ReplicationCreateZoneRedundant. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationCreateZoneRedundant( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .replications() + .define("myReplication") + .withRegion("eastus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("key", "value")) + .withRegionEndpointEnabled(true) + .withZoneRedundancy(ZoneRedundancy.ENABLED) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsDeleteSamples.java new file mode 100644 index 000000000000..57aeb4b26765 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Replications Delete. */ +public final class ReplicationsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ReplicationDelete.json + */ + /** + * Sample code: ReplicationDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.replications().delete("myResourceGroup", "myRegistry", "myReplication", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsGetSamples.java new file mode 100644 index 000000000000..e7af75d0e7a8 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Replications Get. */ +public final class ReplicationsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ReplicationGet.json + */ + /** + * Sample code: ReplicationGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.replications().getWithResponse("myResourceGroup", "myRegistry", "myReplication", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsListSamples.java new file mode 100644 index 000000000000..12e5e79b9771 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Replications List. */ +public final class ReplicationsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ReplicationList.json + */ + /** + * Sample code: ReplicationList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.replications().list("myResourceGroup", "myRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsUpdateSamples.java new file mode 100644 index 000000000000..2ef0993d13bb --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ReplicationsUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.Replication; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Replications Update. */ +public final class ReplicationsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ReplicationUpdate.json + */ + /** + * Sample code: ReplicationUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void replicationUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Replication resource = + manager + .replications() + .getWithResponse("myResourceGroup", "myRegistry", "myReplication", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key", "value")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsCreateSamples.java new file mode 100644 index 000000000000..71bdc677dc52 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsCreateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import java.util.Arrays; + +/** Samples for ScopeMaps Create. */ +public final class ScopeMapsCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ScopeMapCreate.json + */ + /** + * Sample code: ScopeMapCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .scopeMaps() + .define("myScopeMap") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withDescription("Developer Scopes") + .withActions(Arrays.asList("repositories/myrepository/contentWrite", "repositories/myrepository/delete")) + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsDeleteSamples.java new file mode 100644 index 000000000000..7280a6d393c7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeMaps Delete. */ +public final class ScopeMapsDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ScopeMapDelete.json + */ + /** + * Sample code: ScopeMapDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.scopeMaps().delete("myResourceGroup", "myRegistry", "myScopeMap", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsGetSamples.java new file mode 100644 index 000000000000..e5c9dc70f4b5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeMaps Get. */ +public final class ScopeMapsGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ScopeMapGet.json + */ + /** + * Sample code: ScopeMapGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.scopeMaps().getWithResponse("myResourceGroup", "myRegistry", "myScopeMap", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsListSamples.java new file mode 100644 index 000000000000..159aca2c9242 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for ScopeMaps List. */ +public final class ScopeMapsListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ScopeMapList.json + */ + /** + * Sample code: ScopeMapList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.scopeMaps().list("myResourceGroup", "myRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsUpdateSamples.java new file mode 100644 index 000000000000..642753790f22 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/ScopeMapsUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.ScopeMap; +import java.util.Arrays; + +/** Samples for ScopeMaps Update. */ +public final class ScopeMapsUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/ScopeMapUpdate.json + */ + /** + * Sample code: ScopeMapUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void scopeMapUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + ScopeMap resource = + manager.scopeMaps().getWithResponse("myResourceGroup", "myRegistry", "myScopeMap", Context.NONE).getValue(); + resource + .update() + .withDescription("Developer Scopes") + .withActions( + Arrays.asList("repositories/myrepository/contentWrite", "repositories/myrepository/contentRead")) + .apply(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensCreateSamples.java new file mode 100644 index 000000000000..ef6e27a85f25 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensCreateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificate; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificateName; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCredentialsProperties; +import com.azure.resourcemanager.containerregistry.generated.models.TokenStatus; +import java.util.Arrays; + +/** Samples for Tokens Create. */ +public final class TokensCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/TokenCreate.json + */ + /** + * Sample code: TokenCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .tokens() + .define("myToken") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withScopeMapId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap") + .withCredentials( + new TokenCredentialsProperties() + .withCertificates( + Arrays + .asList( + new TokenCertificate() + .withName(TokenCertificateName.CERTIFICATE1) + .withEncodedPemCertificate( + "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==")))) + .withStatus(TokenStatus.DISABLED) + .create(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensDeleteSamples.java new file mode 100644 index 000000000000..f484da450b0b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Tokens Delete. */ +public final class TokensDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/TokenDelete.json + */ + /** + * Sample code: TokenDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tokens().delete("myResourceGroup", "myRegistry", "myToken", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensGetSamples.java new file mode 100644 index 000000000000..4768578614d7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Tokens Get. */ +public final class TokensGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/TokenGet.json + */ + /** + * Sample code: TokenGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tokens().getWithResponse("myResourceGroup", "myRegistry", "myToken", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensListSamples.java new file mode 100644 index 000000000000..9ea43eae68ae --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Tokens List. */ +public final class TokensListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/TokenList.json + */ + /** + * Sample code: TokenList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.tokens().list("myResourceGroup", "myRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensUpdateSamples.java new file mode 100644 index 000000000000..7267580363ef --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/TokensUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.Token; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificate; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCertificateName; +import com.azure.resourcemanager.containerregistry.generated.models.TokenCredentialsProperties; +import java.util.Arrays; + +/** Samples for Tokens Update. */ +public final class TokensUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/TokenUpdate.json + */ + /** + * Sample code: TokenUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void tokenUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Token resource = + manager.tokens().getWithResponse("myResourceGroup", "myRegistry", "myToken", Context.NONE).getValue(); + resource + .update() + .withScopeMapId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myNewScopeMap") + .withCredentials( + new TokenCredentialsProperties() + .withCertificates( + Arrays + .asList( + new TokenCertificate() + .withName(TokenCertificateName.CERTIFICATE1) + .withEncodedPemCertificate( + "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==")))) + .apply(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksCreateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksCreateSamples.java new file mode 100644 index 000000000000..8f0eb87c56c2 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksCreateSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Webhooks Create. */ +public final class WebhooksCreateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookCreate.json + */ + /** + * Sample code: WebhookCreate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookCreate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager + .webhooks() + .define("myWebhook") + .withRegion("westus") + .withExistingRegistry("myResourceGroup", "myRegistry") + .withTags(mapOf("key", "value")) + .withServiceUri("http://myservice.com") + .withCustomHeaders(mapOf("Authorization", "Basic 000000000000000000000000000000000000000000000000000")) + .withStatus(WebhookStatus.ENABLED) + .withScope("myRepository") + .withActions(Arrays.asList(WebhookAction.PUSH)) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksDeleteSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksDeleteSamples.java new file mode 100644 index 000000000000..0a207996e872 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Webhooks Delete. */ +public final class WebhooksDeleteSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookDelete.json + */ + /** + * Sample code: WebhookDelete. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookDelete( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().delete("myResourceGroup", "myRegistry", "myWebhook", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksGetCallbackConfigSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksGetCallbackConfigSamples.java new file mode 100644 index 000000000000..44fae5f66ec0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksGetCallbackConfigSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Webhooks GetCallbackConfig. */ +public final class WebhooksGetCallbackConfigSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookGetCallbackConfig.json + */ + /** + * Sample code: WebhookGetCallbackConfig. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookGetCallbackConfig( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().getCallbackConfigWithResponse("myResourceGroup", "myRegistry", "myWebhook", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksGetSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksGetSamples.java new file mode 100644 index 000000000000..da8c1a724a8e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Webhooks Get. */ +public final class WebhooksGetSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookGet.json + */ + /** + * Sample code: WebhookGet. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookGet( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().getWithResponse("myResourceGroup", "myRegistry", "myWebhook", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksListEventsSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksListEventsSamples.java new file mode 100644 index 000000000000..f5191396e0cf --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksListEventsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Webhooks ListEvents. */ +public final class WebhooksListEventsSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookListEvents.json + */ + /** + * Sample code: WebhookListEvents. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookListEvents( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().listEvents("myResourceGroup", "myRegistry", "myWebhook", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksListSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksListSamples.java new file mode 100644 index 000000000000..5c8f1aae2d8c --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Webhooks List. */ +public final class WebhooksListSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookList.json + */ + /** + * Sample code: WebhookList. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookList( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().list("myResourceGroup", "myRegistry", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksPingSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksPingSamples.java new file mode 100644 index 000000000000..26a594ed805b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksPingSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; + +/** Samples for Webhooks Ping. */ +public final class WebhooksPingSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookPing.json + */ + /** + * Sample code: WebhookPing. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookPing( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + manager.webhooks().pingWithResponse("myResourceGroup", "myRegistry", "myWebhook", Context.NONE); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksUpdateSamples.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksUpdateSamples.java new file mode 100644 index 000000000000..79c641e6bdaa --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-generated/src/samples/java/com/azure/resourcemanager/containerregistry/generated/generated/WebhooksUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.generated.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerregistry.generated.models.Webhook; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookAction; +import com.azure.resourcemanager.containerregistry.generated.models.WebhookStatus; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Webhooks Update. */ +public final class WebhooksUpdateSamples { + /* + * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2022-02-01-preview/examples/WebhookUpdate.json + */ + /** + * Sample code: WebhookUpdate. + * + * @param manager Entry point to ContainerRegistryManager. + */ + public static void webhookUpdate( + com.azure.resourcemanager.containerregistry.generated.ContainerRegistryManager manager) { + Webhook resource = + manager.webhooks().getWithResponse("myResourceGroup", "myRegistry", "myWebhook", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("key", "value")) + .withServiceUri("http://myservice.com") + .withCustomHeaders(mapOf("Authorization", "Basic 000000000000000000000000000000000000000000000000000")) + .withStatus(WebhookStatus.ENABLED) + .withScope("myRepository") + .withActions(Arrays.asList(WebhookAction.PUSH)) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerregistry/ci.yml b/sdk/containerregistry/ci.yml index e195746bdf1d..66cd678cbee7 100644 --- a/sdk/containerregistry/ci.yml +++ b/sdk/containerregistry/ci.yml @@ -41,3 +41,6 @@ extends: - name: azure-containers-containerregistry groupId: com.azure safeName: azurecontainerscontainerregistry + - name: azure-resourcemanager-containerregistry-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagercontainerregistrygenerated diff --git a/sdk/containerregistry/pom.xml b/sdk/containerregistry/pom.xml index 69385d74b30a..70b880af3473 100644 --- a/sdk/containerregistry/pom.xml +++ b/sdk/containerregistry/pom.xml @@ -43,6 +43,7 @@ azure-containers-containerregistry azure-containers-containerregistry-perf + azure-resourcemanager-containerregistry-generated