From 9c5b941c166082309b3b4454cda6c8c700f51486 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 9 Apr 2025 07:06:54 +0000 Subject: [PATCH] CodeGen from PR 33501 in Azure/azure-rest-api-specs Merge 870a8b468208edac0a274f846437f67deaeab489 into e436160e64c0f8d7fb20d662be2712f71f0a7ef5 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + sdk/vi/azure-resourcemanager-vi/CHANGELOG.md | 8 + sdk/vi/azure-resourcemanager-vi/README.md | 102 ++ sdk/vi/azure-resourcemanager-vi/SAMPLE.md | 889 +++++++++++++ sdk/vi/azure-resourcemanager-vi/pom.xml | 63 + .../azure/resourcemanager/vi/ViManager.java | 347 +++++ .../vi/fluent/AccountsClient.java | 210 ++++ .../vi/fluent/GeneratesClient.java | 136 ++ .../vi/fluent/OperationsClient.java | 38 + .../PrivateEndpointConnectionsClient.java | 217 ++++ .../vi/fluent/PrivateLinkResourcesClient.java | 76 ++ .../vi/fluent/ViManagementClient.java | 83 ++ .../vi/fluent/models/AccessTokenInner.java | 81 ++ .../vi/fluent/models/AccountInner.java | 382 ++++++ .../AccountPropertiesForPatchRequest.java | 250 ++++ .../AccountPropertiesForPutRequest.java | 315 +++++ .../CheckNameAvailabilityResultInner.java | 120 ++ .../vi/fluent/models/OperationInner.java | 149 +++ .../PrivateEndpointConnectionInner.java | 242 ++++ .../PrivateEndpointConnectionProperties.java | 193 +++ .../models/PrivateLinkResourceInner.java | 197 +++ .../models/PrivateLinkResourceProperties.java | 130 ++ .../vi/fluent/models/package-info.java | 9 + .../vi/fluent/package-info.java | 9 + .../vi/implementation/AccessTokenImpl.java | 31 + .../vi/implementation/AccountImpl.java | 287 +++++ .../vi/implementation/AccountsClientImpl.java | 1113 +++++++++++++++++ .../vi/implementation/AccountsImpl.java | 172 +++ .../CheckNameAvailabilityResultImpl.java | 41 + .../implementation/GeneratesClientImpl.java | 635 ++++++++++ .../vi/implementation/GeneratesImpl.java | 124 ++ .../vi/implementation/OperationImpl.java | 48 + .../implementation/OperationsClientImpl.java | 231 ++++ .../vi/implementation/OperationsImpl.java | 44 + .../PrivateEndpointConnectionImpl.java | 166 +++ .../PrivateEndpointConnectionsClientImpl.java | 978 +++++++++++++++ .../PrivateEndpointConnectionsImpl.java | 167 +++ .../PrivateLinkResourceImpl.java | 69 + .../PrivateLinkResourcesClientImpl.java | 422 +++++++ .../PrivateLinkResourcesImpl.java | 71 ++ .../implementation/ResourceManagerUtils.java | 195 +++ .../ViManagementClientBuilder.java | 138 ++ .../ViManagementClientImpl.java | 352 ++++++ .../vi/implementation/package-info.java | 9 + .../vi/models/AccessToken.java | 26 + .../resourcemanager/vi/models/Account.java | 469 +++++++ ...ccountCheckNameAvailabilityParameters.java | 137 ++ .../vi/models/AccountList.java | 115 ++ .../vi/models/AccountPatch.java | 253 ++++ .../resourcemanager/vi/models/Accounts.java | 188 +++ .../models/CheckNameAvailabilityResult.java | 42 + .../models/GenerateAccessTokenParameters.java | 194 +++ ...enerateExtensionAccessTokenParameters.java | 232 ++++ ...RestrictedViewerAccessTokenParameters.java | 201 +++ ...RestrictedViewerAccessTokenParameters.java | 161 +++ .../resourcemanager/vi/models/Generates.java | 121 ++ .../vi/models/ManagedServiceIdentity.java | 190 +++ .../vi/models/ManagedServiceIdentityType.java | 62 + .../models/OpenAiServicesForPatchRequest.java | 122 ++ .../models/OpenAiServicesForPutRequest.java | 121 ++ .../resourcemanager/vi/models/Operation.java | 54 + .../vi/models/OperationDisplay.java | 129 ++ .../vi/models/OperationListResult.java | 103 ++ .../resourcemanager/vi/models/Operations.java | 33 + .../vi/models/PermissionType.java | 51 + .../vi/models/PrivateEndpoint.java | 81 ++ .../vi/models/PrivateEndpointConnection.java | 274 ++++ .../PrivateEndpointConnectionListResult.java | 118 ++ ...teEndpointConnectionProvisioningState.java | 62 + .../vi/models/PrivateEndpointConnections.java | 154 +++ ...rivateEndpointServiceConnectionStatus.java | 57 + .../vi/models/PrivateLinkResource.java | 70 ++ .../models/PrivateLinkResourceListResult.java | 117 ++ .../vi/models/PrivateLinkResources.java | 68 + .../PrivateLinkServiceConnectionState.java | 155 +++ .../vi/models/ProvisioningState.java | 71 ++ .../vi/models/PublicNetworkAccess.java | 51 + .../resourcemanager/vi/models/Reason.java | 47 + .../resourcemanager/vi/models/Scope.java | 56 + .../StorageServicesForPatchRequest.java | 94 ++ .../models/StorageServicesForPutRequest.java | 121 ++ .../azure/resourcemanager/vi/models/Tags.java | 95 ++ .../azure/resourcemanager/vi/models/Type.java | 46 + .../vi/models/UserAssignedIdentity.java | 100 ++ .../vi/models/package-info.java | 9 + .../resourcemanager/vi/package-info.java | 9 + .../src/main/java/module-info.java | 15 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + .../azure-resourcemanager-vi.properties | 1 + .../AccountsCheckNameAvailabilitySamples.java | 43 + .../AccountsCreateOrUpdateSamples.java | 136 ++ .../vi/generated/AccountsDeleteSamples.java | 25 + .../AccountsGetByResourceGroupSamples.java | 24 + .../AccountsListByResourceGroupSamples.java | 24 + .../vi/generated/AccountsListSamples.java | 23 + .../vi/generated/AccountsUpdateSamples.java | 85 ++ .../generated/GenerateAccessTokenSamples.java | 125 ++ .../GenerateExtensionAccessTokenSamples.java | 94 ++ ...ionRestrictedViewerAccessTokenSamples.java | 53 + ...ateRestrictedViewerAccessTokenSamples.java | 62 + .../vi/generated/OperationsListSamples.java | 23 + ...pointConnectionsCreateOrUpdateSamples.java | 33 + ...ivateEndpointConnectionsDeleteSamples.java | 25 + .../PrivateEndpointConnectionsGetSamples.java | 25 + ...dpointConnectionsListByAccountSamples.java | 24 + .../PrivateLinkResourcesGetSamples.java | 24 + ...vateLinkResourcesListByAccountSamples.java | 24 + sdk/vi/ci.yml | 46 + sdk/vi/pom.xml | 15 + 111 files changed, 15351 insertions(+) create mode 100644 sdk/vi/azure-resourcemanager-vi/CHANGELOG.md create mode 100644 sdk/vi/azure-resourcemanager-vi/README.md create mode 100644 sdk/vi/azure-resourcemanager-vi/SAMPLE.md create mode 100644 sdk/vi/azure-resourcemanager-vi/pom.xml create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/ViManager.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/AccountsClient.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/GeneratesClient.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/OperationsClient.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/PrivateEndpointConnectionsClient.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/PrivateLinkResourcesClient.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/ViManagementClient.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccessTokenInner.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccountInner.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccountPropertiesForPatchRequest.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccountPropertiesForPutRequest.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/CheckNameAvailabilityResultInner.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/OperationInner.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateEndpointConnectionInner.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateEndpointConnectionProperties.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateLinkResourceInner.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateLinkResourceProperties.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/package-info.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/package-info.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccessTokenImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccountImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccountsClientImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccountsImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/CheckNameAvailabilityResultImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/GeneratesClientImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/GeneratesImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/OperationImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/OperationsClientImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/OperationsImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateLinkResourceImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateLinkResourcesClientImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateLinkResourcesImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/ResourceManagerUtils.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/ViManagementClientBuilder.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/ViManagementClientImpl.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/package-info.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccessToken.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Account.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccountCheckNameAvailabilityParameters.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccountList.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccountPatch.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Accounts.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/CheckNameAvailabilityResult.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateAccessTokenParameters.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateExtensionAccessTokenParameters.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateExtensionRestrictedViewerAccessTokenParameters.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateRestrictedViewerAccessTokenParameters.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Generates.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/ManagedServiceIdentity.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/ManagedServiceIdentityType.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OpenAiServicesForPatchRequest.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OpenAiServicesForPutRequest.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Operation.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OperationDisplay.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OperationListResult.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Operations.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PermissionType.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpoint.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnection.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnectionListResult.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnectionProvisioningState.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnections.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointServiceConnectionStatus.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkResource.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkResourceListResult.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkResources.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkServiceConnectionState.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/ProvisioningState.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PublicNetworkAccess.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Reason.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Scope.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/StorageServicesForPatchRequest.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/StorageServicesForPutRequest.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Tags.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Type.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/UserAssignedIdentity.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/package-info.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/package-info.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/java/module-info.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-vi/proxy-config.json create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-vi/reflect-config.json create mode 100644 sdk/vi/azure-resourcemanager-vi/src/main/resources/azure-resourcemanager-vi.properties create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsCheckNameAvailabilitySamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsCreateOrUpdateSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsDeleteSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsGetByResourceGroupSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsListByResourceGroupSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsListSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsUpdateSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateAccessTokenSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateExtensionAccessTokenSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateExtensionRestrictedViewerAccessTokenSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateRestrictedViewerAccessTokenSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/OperationsListSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateEndpointConnectionsListByAccountSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateLinkResourcesGetSamples.java create mode 100644 sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateLinkResourcesListByAccountSamples.java create mode 100644 sdk/vi/ci.yml create mode 100644 sdk/vi/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 43ae4afcb6a7..b5411eb757c3 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -473,6 +473,7 @@ com.azure.resourcemanager:azure-resourcemanager-databasewatcher;1.0.0-beta.1;1.0 com.azure.resourcemanager:azure-resourcemanager-durabletask;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-arizeaiobservabilityeval;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-weightsandbiases;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-vi;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.1;2.0.0-beta.1 diff --git a/pom.xml b/pom.xml index 08b3c5475c08..656f5f0b8b6c 100644 --- a/pom.xml +++ b/pom.xml @@ -232,6 +232,7 @@ sdk/tools sdk/translation sdk/trustedsigning + sdk/vi sdk/vision sdk/vmwarecloudsimple sdk/voiceservices diff --git a/sdk/vi/azure-resourcemanager-vi/CHANGELOG.md b/sdk/vi/azure-resourcemanager-vi/CHANGELOG.md new file mode 100644 index 000000000000..fc882f59df48 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2025-04-09) + +- Azure Resource Manager Vi client library for Java. This package contains Microsoft Azure SDK for Vi Management SDK. Microsoft Azure Video Indexer. Package tag package-2025-04-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-vi Java SDK. diff --git a/sdk/vi/azure-resourcemanager-vi/README.md b/sdk/vi/azure-resourcemanager-vi/README.md new file mode 100644 index 000000000000..699eb14d6e11 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Vi client library for Java + +Azure Resource Manager Vi client library for Java. + +This package contains Microsoft Azure SDK for Vi Management SDK. Microsoft Azure Video Indexer. Package tag package-2025-04-01. 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-vi;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-vi + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ViManager manager = ViManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` 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/vi/azure-resourcemanager-vi/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/vi/azure-resourcemanager-vi/SAMPLE.md b/sdk/vi/azure-resourcemanager-vi/SAMPLE.md new file mode 100644 index 000000000000..b3e328d4495e --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/SAMPLE.md @@ -0,0 +1,889 @@ +# Code snippets and samples + + +## Accounts + +- [CheckNameAvailability](#accounts_checknameavailability) +- [CreateOrUpdate](#accounts_createorupdate) +- [Delete](#accounts_delete) +- [GetByResourceGroup](#accounts_getbyresourcegroup) +- [List](#accounts_list) +- [ListByResourceGroup](#accounts_listbyresourcegroup) +- [Update](#accounts_update) + +## Generate + +- [AccessToken](#generate_accesstoken) +- [ExtensionAccessToken](#generate_extensionaccesstoken) +- [ExtensionRestrictedViewerAccessToken](#generate_extensionrestrictedvieweraccesstoken) +- [RestrictedViewerAccessToken](#generate_restrictedvieweraccesstoken) + +## Operations + +- [List](#operations_list) + +## PrivateEndpointConnections + +- [CreateOrUpdate](#privateendpointconnections_createorupdate) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [ListByAccount](#privateendpointconnections_listbyaccount) + +## PrivateLinkResources + +- [Get](#privatelinkresources_get) +- [ListByAccount](#privatelinkresources_listbyaccount) +### Accounts_CheckNameAvailability + +```java +import com.azure.resourcemanager.vi.models.AccountCheckNameAvailabilityParameters; +import com.azure.resourcemanager.vi.models.Type; + +/** + * Samples for Accounts CheckNameAvailability. + */ +public final class AccountsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViAccountCheckNameAvailabilityFree.json + */ + /** + * Sample code: Check free account name availability. + * + * @param manager Entry point to ViManager. + */ + public static void checkFreeAccountNameAvailability(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .checkNameAvailabilityWithResponse(new AccountCheckNameAvailabilityParameters().withName("vi1") + .withType(Type.MICROSOFT_VIDEO_INDEXER_ACCOUNTS), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViAccountCheckNameAvailabilityTaken.json + */ + /** + * Sample code: Check taken account name availability. + * + * @param manager Entry point to ViManager. + */ + public static void checkTakenAccountNameAvailability(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .checkNameAvailabilityWithResponse(new AccountCheckNameAvailabilityParameters().withName("vi1") + .withType(Type.MICROSOFT_VIDEO_INDEXER_ACCOUNTS), com.azure.core.util.Context.NONE); + } +} +``` + +### Accounts_CreateOrUpdate + +```java +import com.azure.resourcemanager.vi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.vi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.vi.models.OpenAiServicesForPutRequest; +import com.azure.resourcemanager.vi.models.StorageServicesForPutRequest; +import com.azure.resourcemanager.vi.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Accounts CreateOrUpdate. + */ +public final class AccountsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountPut/ + * ConnectClassicAccountToArmAccountUsingSystemAssignedMI.json + */ + /** + * Sample code: Connect classic account to arm account using system assigned Mi. + * + * @param manager Entry point to ViManager. + */ + public static void + connectClassicAccountToArmAccountUsingSystemAssignedMi(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .define("contosto-videoanalyzer") + .withRegion("NorthEurope") + .withExistingResourceGroup("contosto-videoanalyzer-rg") + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withAccountId("462af7c5-d1f6-4b91-86e3-8bc5e8a61574") + .withStorageServices(new StorageServicesForPutRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.Storage/storageAccounts/contoso-videoanalyzer-ms")) + .create(); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountPut/ + * ConnectClassicAccountToArmAccountUsingUserAssignedMi.json + */ + /** + * Sample code: Connect classic account to arm account using user assigned Mi. + * + * @param manager Entry point to ViManager. + */ + public static void + connectClassicAccountToArmAccountUsingUserAssignedMi(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .define("contosto-videoanalyzer") + .withRegion("NorthEurope") + .withExistingResourceGroup("contosto-videoanalyzer-rg") + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi", + new UserAssignedIdentity()))) + .withAccountId("462af7c5-d1f6-4b91-86e3-8bc5e8a61574") + .withStorageServices(new StorageServicesForPutRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.Storage/storageAccounts/contoso-videoanalyzer-ms") + .withUserAssignedIdentity( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi")) + .create(); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountPut/ + * CreateOrUpdateAccountWithUserAssignedMi.json + */ + /** + * Sample code: Create or update account with user assigned Mi. + * + * @param manager Entry point to ViManager. + */ + public static void createOrUpdateAccountWithUserAssignedMi(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .define("contosto-videoanalyzer") + .withRegion("NorthEurope") + .withExistingResourceGroup("contosto-videoanalyzer-rg") + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi", + new UserAssignedIdentity(), + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi2", + new UserAssignedIdentity()))) + .withStorageServices(new StorageServicesForPutRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.Storage/storageAccounts/contoso-videoanalyzer-ms") + .withUserAssignedIdentity( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi")) + .withOpenAiServices(new OpenAiServicesForPutRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.CognitiveServices/accounts/contoso-viopenai-ms") + .withUserAssignedIdentity( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi2")) + .create(); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountPut/ + * CreateOrUpdateAccountWithSystemAssignedMi.json + */ + /** + * Sample code: Create or update account with system assigned Mi. + * + * @param manager Entry point to ViManager. + */ + public static void createOrUpdateAccountWithSystemAssignedMi(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .define("contosto-videoanalyzer") + .withRegion("NorthEurope") + .withExistingResourceGroup("contosto-videoanalyzer-rg") + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withStorageServices(new StorageServicesForPutRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.Storage/storageAccounts/contoso-videoanalyzer-ms")) + .withOpenAiServices(new OpenAiServicesForPutRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.CognitiveServices/accounts/contoso-viopenai-ms")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Accounts_Delete + +```java +/** + * Samples for Accounts Delete. + */ +public final class AccountsDeleteSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountDelete.json + */ + /** + * Sample code: Delete account. + * + * @param manager Entry point to ViManager. + */ + public static void deleteAccount(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .deleteByResourceGroupWithResponse("contoso-rg", "contosto-videoanalyzer", + com.azure.core.util.Context.NONE); + } +} +``` + +### Accounts_GetByResourceGroup + +```java +/** + * Samples for Accounts GetByResourceGroup. + */ +public final class AccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountGet.json + */ + /** + * Sample code: Get account. + * + * @param manager Entry point to ViManager. + */ + public static void getAccount(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .getByResourceGroupWithResponse("contoso-rg", "contosto-videoanalyzer", com.azure.core.util.Context.NONE); + } +} +``` + +### Accounts_List + +```java +/** + * Samples for Accounts List. + */ +public final class AccountsListSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountsList.json + */ + /** + * Sample code: List accounts. + * + * @param manager Entry point to ViManager. + */ + public static void listAccounts(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Accounts_ListByResourceGroup + +```java +/** + * Samples for Accounts ListByResourceGroup. + */ +public final class AccountsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountsListByResourceGroup + * .json + */ + /** + * Sample code: List accounts by resource group. + * + * @param manager Entry point to ViManager. + */ + public static void listAccountsByResourceGroup(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts().listByResourceGroup("contoso-videoanalyzer-rg", com.azure.core.util.Context.NONE); + } +} +``` + +### Accounts_Update + +```java +import com.azure.resourcemanager.vi.models.Account; +import com.azure.resourcemanager.vi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.vi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.vi.models.OpenAiServicesForPatchRequest; +import com.azure.resourcemanager.vi.models.StorageServicesForPatchRequest; +import com.azure.resourcemanager.vi.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Accounts Update. + */ +public final class AccountsUpdateSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountPatch/ + * PatchAccountWithUserAssignedMi.json + */ + /** + * Sample code: Patch account with user assigned Mi. + * + * @param manager Entry point to ViManager. + */ + public static void patchAccountWithUserAssignedMi(com.azure.resourcemanager.vi.ViManager manager) { + Account resource = manager.accounts() + .getByResourceGroupWithResponse("contosto-videoanalyzer-rg", "contosto-videoanalyzer", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi", + new UserAssignedIdentity(), + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi2", + new UserAssignedIdentity()))) + .withStorageServices(new StorageServicesForPatchRequest().withUserAssignedIdentity( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi")) + .withOpenAiServices(new OpenAiServicesForPatchRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.CognitiveServices/accounts/contoso-viopenai-ms") + .withUserAssignedIdentity( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi2")) + .apply(); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountPatch/ + * PatchAccountWithSystemAssignedMi.json + */ + /** + * Sample code: Patch account with system assigned Mi. + * + * @param manager Entry point to ViManager. + */ + public static void patchAccountWithSystemAssignedMi(com.azure.resourcemanager.vi.ViManager manager) { + Account resource = manager.accounts() + .getByResourceGroupWithResponse("contoso-videoanalyzer-rg", "contosto-videoanalyzer", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withStorageServices(new StorageServicesForPatchRequest()) + .withOpenAiServices(new OpenAiServicesForPatchRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.CognitiveServices/accounts/contoso-viopenai-ms")) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Generate_AccessToken + +```java +import com.azure.resourcemanager.vi.models.GenerateAccessTokenParameters; +import com.azure.resourcemanager.vi.models.PermissionType; +import com.azure.resourcemanager.vi.models.Scope; + +/** + * Samples for Generate AccessToken. + */ +public final class GenerateAccessTokenSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViGenerateAccessToken/ + * ViGenerateProjectContributerAccessToken.json + */ + /** + * Sample code: Generate accessToken for project contributor. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForProjectContributor(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .accessTokenWithResponse("contosto-videoanalyzer-rg", "contosto-videoanalyzer", + new GenerateAccessTokenParameters().withPermissionType(PermissionType.CONTRIBUTOR) + .withScope(Scope.PROJECT) + .withProjectId("07ec9e38d4"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViGenerateAccessToken/ + * ViGenerateProjectReaderAccessToken.json + */ + /** + * Sample code: Generate accessToken for project reader. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForProjectReader(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .accessTokenWithResponse("contosto-videoanalyzer-rg", "contosto-videoanalyzer", + new GenerateAccessTokenParameters().withPermissionType(PermissionType.READER) + .withScope(Scope.PROJECT) + .withProjectId("07ec9e38d4"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViGenerateAccessToken/ + * ViGenerateAccountContributerAccessToken.json + */ + /** + * Sample code: Generate accessToken for account contributor. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForAccountContributor(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .accessTokenWithResponse("contosto-videoanalyzer-rg", "contosto-videoanalyzer", + new GenerateAccessTokenParameters().withPermissionType(PermissionType.CONTRIBUTOR) + .withScope(Scope.ACCOUNT), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViGenerateAccessToken/ + * ViGenerateAccountReaderAccessToken.json + */ + /** + * Sample code: Generate accessToken for account reader. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForAccountReader(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .accessTokenWithResponse("contosto-videoanalyzer-rg", "contosto-videoanalyzer", + new GenerateAccessTokenParameters().withPermissionType(PermissionType.READER).withScope(Scope.ACCOUNT), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViGenerateAccessToken/ + * ViGenerateVideoContributerAccessToken.json + */ + /** + * Sample code: Generate accessToken for video contributor. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForVideoContributor(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .accessTokenWithResponse("contosto-videoanalyzer-rg", "contosto-videoanalyzer", + new GenerateAccessTokenParameters().withPermissionType(PermissionType.CONTRIBUTOR) + .withScope(Scope.VIDEO) + .withVideoId("07ec9e38d4"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViGenerateAccessToken/ + * ViGenerateVideoReaderAccessToken.json + */ + /** + * Sample code: Generate accessToken for video reader. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForVideoReader(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .accessTokenWithResponse("contosto-videoanalyzer-rg", "contosto-videoanalyzer", + new GenerateAccessTokenParameters().withPermissionType(PermissionType.READER) + .withScope(Scope.VIDEO) + .withVideoId("07ec9e38d4"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Generate_ExtensionAccessToken + +```java +import com.azure.resourcemanager.vi.models.GenerateExtensionAccessTokenParameters; +import com.azure.resourcemanager.vi.models.PermissionType; +import com.azure.resourcemanager.vi.models.Scope; + +/** + * Samples for Generate ExtensionAccessToken. + */ +public final class GenerateExtensionAccessTokenSamples { + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateExtensionAccessToken/ViGenerateAccountContributerAccessToken.json + */ + /** + * Sample code: Generate accessToken for account contributor. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForAccountContributor(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .extensionAccessTokenWithResponse("contoso-videoindexer-rg", "contoso-videoindexer", + new GenerateExtensionAccessTokenParameters().withPermissionType(PermissionType.CONTRIBUTOR) + .withScope(Scope.ACCOUNT) + .withExtensionId( + "/subscriptions/39ks012-8546-4da5-g6w0-8c3cb76dd930/resourceGroups/yl-arc/providers/Microsoft.Kubernetes/ConnectedClusters/yl-arc/providers/Microsoft.KubernetesConfiguration/extensions/exampleid"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateExtensionAccessToken/ViGenerateAccountReaderAccessToken.json + */ + /** + * Sample code: Generate accessToken for account reader. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForAccountReader(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .extensionAccessTokenWithResponse("contoso-videoindexer-rg", "contoso-videoindexer", + new GenerateExtensionAccessTokenParameters().withPermissionType(PermissionType.READER) + .withScope(Scope.ACCOUNT) + .withExtensionId( + "/subscriptions/39ks012-8546-4da5-g6w0-8c3cb76dd930/resourceGroups/yl-arc/providers/Microsoft.Kubernetes/ConnectedClusters/yl-arc/providers/Microsoft.KubernetesConfiguration/extensions/exampleid"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateExtensionAccessToken/ViGenerateVideoContributerAccessToken.json + */ + /** + * Sample code: Generate accessToken for video contributor. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForVideoContributor(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .extensionAccessTokenWithResponse("contoso-videoindexer-rg", "contoso-videoindexer", + new GenerateExtensionAccessTokenParameters().withPermissionType(PermissionType.CONTRIBUTOR) + .withScope(Scope.VIDEO) + .withExtensionId( + "/subscriptions/39ks012-8546-4da5-g6w0-8c3cb76dd930/resourceGroups/yl-arc/providers/Microsoft.Kubernetes/ConnectedClusters/yl-arc/providers/Microsoft.KubernetesConfiguration/extensions/exampleid") + .withVideoId("07ec9e38d4") + .withTokenLifetimeInSeconds(3600), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateExtensionAccessToken/ViGenerateVideoReaderAccessToken.json + */ + /** + * Sample code: Generate accessToken for video reader. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForVideoReader(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .extensionAccessTokenWithResponse("contoso-videoindexer-rg", "contoso-videoindexer", + new GenerateExtensionAccessTokenParameters().withPermissionType(PermissionType.READER) + .withScope(Scope.VIDEO) + .withExtensionId( + "/subscriptions/39ks012-8546-4da5-g6w0-8c3cb76dd930/resourceGroups/yl-arc/providers/Microsoft.Kubernetes/ConnectedClusters/yl-arc/providers/Microsoft.KubernetesConfiguration/extensions/exampleid") + .withVideoId("07ec9e38d4") + .withTokenLifetimeInSeconds(3600), + com.azure.core.util.Context.NONE); + } +} +``` + +### Generate_ExtensionRestrictedViewerAccessToken + +```java +import com.azure.resourcemanager.vi.models.GenerateExtensionRestrictedViewerAccessTokenParameters; +import com.azure.resourcemanager.vi.models.Scope; + +/** + * Samples for Generate ExtensionRestrictedViewerAccessToken. + */ +public final class GenerateExtensionRestrictedViewerAccessTokenSamples { + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateExtensionRestrictedViewerAccessToken/ViGenerateAccountRestrictedViewerAccessToken.json + */ + /** + * Sample code: Generate restricted viewer accessToken for account. + * + * @param manager Entry point to ViManager. + */ + public static void generateRestrictedViewerAccessTokenForAccount(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .extensionRestrictedViewerAccessTokenWithResponse("contosto-azurevideoindexer-rg", + "contosto-azurevideoindexer", + new GenerateExtensionRestrictedViewerAccessTokenParameters().withScope(Scope.ACCOUNT) + .withExtensionId( + "/subscriptions/39ks012-8546-4da5-g6w0-8c3cb76dd930/resourceGroups/yl-arc/providers/Microsoft.Kubernetes/ConnectedClusters/yl-arc/providers/Microsoft.KubernetesConfiguration/extensions/exampleid"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateExtensionRestrictedViewerAccessToken/ViGenerateVideoRestrictedViewerAccessToken.json + */ + /** + * Sample code: Generate restricted viewer accessToken for video #1. + * + * @param manager Entry point to ViManager. + */ + public static void generateRestrictedViewerAccessTokenForVideo1(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .extensionRestrictedViewerAccessTokenWithResponse("contosto-azurevideoindexer-rg", + "contosto-azurevideoindexer", + new GenerateExtensionRestrictedViewerAccessTokenParameters().withScope(Scope.VIDEO) + .withExtensionId( + "/subscriptions/39ks012-8546-4da5-g6w0-8c3cb76dd930/resourceGroups/yl-arc/providers/Microsoft.Kubernetes/ConnectedClusters/yl-arc/providers/Microsoft.KubernetesConfiguration/extensions/exampleid") + .withVideoId("07ec9e38d4") + .withTokenLifetimeInSeconds(3600), + com.azure.core.util.Context.NONE); + } +} +``` + +### Generate_RestrictedViewerAccessToken + +```java +import com.azure.resourcemanager.vi.models.GenerateRestrictedViewerAccessTokenParameters; +import com.azure.resourcemanager.vi.models.Scope; + +/** + * Samples for Generate RestrictedViewerAccessToken. + */ +public final class GenerateRestrictedViewerAccessTokenSamples { + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateRestrictedViewerAccessToken/ViGenerateVideoRestrictedViewerAccessToken.json + */ + /** + * Sample code: Generate restricted viewer accessToken for video. + * + * @param manager Entry point to ViManager. + */ + public static void generateRestrictedViewerAccessTokenForVideo(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .restrictedViewerAccessTokenWithResponse("contosto-azurevideoindexer-rg", "contosto-azurevideoindexer", + new GenerateRestrictedViewerAccessTokenParameters().withScope(Scope.VIDEO).withVideoId("07ec9e38d4"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateRestrictedViewerAccessToken/ViGenerateAccountRestrictedViewerAccessToken.json + */ + /** + * Sample code: Generate restricted viewer accessToken for account. + * + * @param manager Entry point to ViManager. + */ + public static void generateRestrictedViewerAccessTokenForAccount(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .restrictedViewerAccessTokenWithResponse("contosto-azurevideoindexer-rg", "contosto-azurevideoindexer", + new GenerateRestrictedViewerAccessTokenParameters().withScope(Scope.ACCOUNT), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateRestrictedViewerAccessToken/ViGenerateProjectRestrictedViewerAccessToken.json + */ + /** + * Sample code: Generate restricted viewer accessToken for project. + * + * @param manager Entry point to ViManager. + */ + public static void generateRestrictedViewerAccessTokenForProject(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .restrictedViewerAccessTokenWithResponse("contosto-azurevideoindexer-rg", "contosto-azurevideoindexer", + new GenerateRestrictedViewerAccessTokenParameters().withScope(Scope.PROJECT) + .withProjectId("07ec9e38d4"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViOperationsList.json + */ + /** + * Sample code: List operations. + * + * @param manager Entry point to ViManager. + */ + public static void listOperations(com.azure.resourcemanager.vi.ViManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.vi.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.vi.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections CreateOrUpdate. + */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/PrivateEndpointConnections/ + * PrivateEndpointConnection_CreateOrUpdate.json + */ + /** + * Sample code: PrivateEndpointConnectionCreateOrUpdate. + * + * @param manager Entry point to ViManager. + */ + public static void privateEndpointConnectionCreateOrUpdate(com.azure.resourcemanager.vi.ViManager manager) { + manager.privateEndpointConnections() + .define("peexample01") + .withExistingAccount("test-rg", "contoso") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/PrivateEndpointConnections/ + * PrivateEndpointConnection_Delete.json + */ + /** + * Sample code: PrivateEndpointConnectionDelete. + * + * @param manager Entry point to ViManager. + */ + public static void privateEndpointConnectionDelete(com.azure.resourcemanager.vi.ViManager manager) { + manager.privateEndpointConnections() + .delete("test-rg", "contoso", "peexample01", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/PrivateEndpointConnections/ + * PrivateEndpointConnection_Get.json + */ + /** + * Sample code: PrivateEndpointConnectionGet. + * + * @param manager Entry point to ViManager. + */ + public static void privateEndpointConnectionGet(com.azure.resourcemanager.vi.ViManager manager) { + manager.privateEndpointConnections() + .getWithResponse("test-rg", "contoso", "peexample01", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_ListByAccount + +```java +/** + * Samples for PrivateEndpointConnections ListByAccount. + */ +public final class PrivateEndpointConnectionsListByAccountSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/PrivateEndpointConnections/ + * PrivateEndpointConnection_ListByAccount.json + */ + /** + * Sample code: PrivateEndpointConnectionList. + * + * @param manager Entry point to ViManager. + */ + public static void privateEndpointConnectionList(com.azure.resourcemanager.vi.ViManager manager) { + manager.privateEndpointConnections().listByAccount("test-rg", "contoso", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResources_Get + +```java +/** + * Samples for PrivateLinkResources Get. + */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/PrivateLinkResources/ + * PrivateLinkResources_Get.json + */ + /** + * Sample code: PrivateLinkResourcesGet. + * + * @param manager Entry point to ViManager. + */ + public static void privateLinkResourcesGet(com.azure.resourcemanager.vi.ViManager manager) { + manager.privateLinkResources().getWithResponse("test-rg", "contoso", "avi", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResources_ListByAccount + +```java +/** + * Samples for PrivateLinkResources ListByAccount. + */ +public final class PrivateLinkResourcesListByAccountSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/PrivateLinkResources/ + * PrivateLinkResources_ListByAccount.json + */ + /** + * Sample code: PrivateLinkResourcesList. + * + * @param manager Entry point to ViManager. + */ + public static void privateLinkResourcesList(com.azure.resourcemanager.vi.ViManager manager) { + manager.privateLinkResources().listByAccount("test-rg", "contoso", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/vi/azure-resourcemanager-vi/pom.xml b/sdk/vi/azure-resourcemanager-vi/pom.xml new file mode 100644 index 000000000000..f9167ef87e0a --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-vi + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Vi Management + This package contains Microsoft Azure SDK for Vi Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Azure Video Indexer. Package tag package-2025-04-01. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + false + + + + com.azure + azure-core + 1.55.3 + + + com.azure + azure-core-management + 1.17.0 + + + diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/ViManager.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/ViManager.java new file mode 100644 index 000000000000..641f68d43eb8 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/ViManager.java @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.vi.fluent.ViManagementClient; +import com.azure.resourcemanager.vi.implementation.AccountsImpl; +import com.azure.resourcemanager.vi.implementation.GeneratesImpl; +import com.azure.resourcemanager.vi.implementation.OperationsImpl; +import com.azure.resourcemanager.vi.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.vi.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.vi.implementation.ViManagementClientBuilder; +import com.azure.resourcemanager.vi.models.Accounts; +import com.azure.resourcemanager.vi.models.Generates; +import com.azure.resourcemanager.vi.models.Operations; +import com.azure.resourcemanager.vi.models.PrivateEndpointConnections; +import com.azure.resourcemanager.vi.models.PrivateLinkResources; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to ViManager. + * Microsoft Azure Video Indexer. + */ +public final class ViManager { + private Operations operations; + + private Accounts accounts; + + private Generates generates; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + + private final ViManagementClient clientObject; + + private ViManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new ViManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Vi service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Vi service API instance. + */ + public static ViManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Vi service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Vi service API instance. + */ + public static ViManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ViManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create ViManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ViManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-vi.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Vi service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Vi service API instance. + */ + public ViManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.vi") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(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 ViManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of Accounts. It manages Account. + * + * @return Resource collection API of Accounts. + */ + public Accounts accounts() { + if (this.accounts == null) { + this.accounts = new AccountsImpl(clientObject.getAccounts(), this); + } + return accounts; + } + + /** + * Gets the resource collection API of Generates. + * + * @return Resource collection API of Generates. + */ + public Generates generates() { + if (this.generates == null) { + this.generates = new GeneratesImpl(clientObject.getGenerates(), this); + } + return generates; + } + + /** + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections + = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** + * Gets wrapped service client ViManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client ViManagementClient. + */ + public ViManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/AccountsClient.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/AccountsClient.java new file mode 100644 index 000000000000..dc78dffc3e9e --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/AccountsClient.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.vi.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.util.Context; +import com.azure.resourcemanager.vi.fluent.models.AccountInner; +import com.azure.resourcemanager.vi.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.vi.models.AccountCheckNameAvailabilityParameters; +import com.azure.resourcemanager.vi.models.AccountPatch; + +/** + * An instance of this class provides access to all the operations defined in AccountsClient. + */ +public interface AccountsClient { + /** + * Checks that the Video Indexer account name is valid and is not already in use. + * + * @param checkNameAvailabilityParameters The name of the Video Indexer account. Name must be unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + AccountCheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context); + + /** + * Checks that the Video Indexer account name is valid and is not already in use. + * + * @param checkNameAvailabilityParameters The name of the Video Indexer account. Name must be unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResultInner + checkNameAvailability(AccountCheckNameAvailabilityParameters checkNameAvailabilityParameters); + + /** + * List all Azure Video Indexer accounts available under the 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 list operation response, that contains the data pools and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all Azure Video Indexer accounts available under the 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 list operation response, that contains the data pools and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List all Azure Video Indexer accounts available under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation response, that contains the data pools and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all Azure Video Indexer accounts available under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation response, that contains the data pools and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the properties of an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an Azure Video Indexer account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, + Context context); + + /** + * Gets the properties of an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an Azure Video Indexer account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountInner getByResourceGroup(String resourceGroupName, String accountName); + + /** + * Updates the properties of an existing Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters to provide for the current Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Video Indexer account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String accountName, AccountPatch parameters, + Context context); + + /** + * Updates the properties of an existing Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Video Indexer account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountInner update(String resourceGroupName, String accountName); + + /** + * Creates or updates an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters to provide for the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Video Indexer account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + AccountInner parameters, Context context); + + /** + * Creates or updates an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Video Indexer account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountInner createOrUpdate(String resourceGroupName, String accountName); + + /** + * Delete an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Delete an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 accountName); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/GeneratesClient.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/GeneratesClient.java new file mode 100644 index 000000000000..60314d7112da --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/GeneratesClient.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.vi.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.vi.fluent.models.AccessTokenInner; +import com.azure.resourcemanager.vi.models.GenerateAccessTokenParameters; +import com.azure.resourcemanager.vi.models.GenerateExtensionAccessTokenParameters; +import com.azure.resourcemanager.vi.models.GenerateExtensionRestrictedViewerAccessTokenParameters; +import com.azure.resourcemanager.vi.models.GenerateRestrictedViewerAccessTokenParameters; + +/** + * An instance of this class provides access to all the operations defined in GeneratesClient. + */ +public interface GeneratesClient { + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating access 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 azure Video Indexer access token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response accessTokenWithResponse(String resourceGroupName, String accountName, + GenerateAccessTokenParameters parameters, Context context); + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessTokenInner accessToken(String resourceGroupName, String accountName); + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating restricted viewer access 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 azure Video Indexer access token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response restrictedViewerAccessTokenWithResponse(String resourceGroupName, String accountName, + GenerateRestrictedViewerAccessTokenParameters parameters, Context context); + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessTokenInner restrictedViewerAccessToken(String resourceGroupName, String accountName); + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating access 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 azure Video Indexer access token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response extensionAccessTokenWithResponse(String resourceGroupName, String accountName, + GenerateExtensionAccessTokenParameters parameters, Context context); + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessTokenInner extensionAccessToken(String resourceGroupName, String accountName); + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating restricted viewer access 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 azure Video Indexer access token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response extensionRestrictedViewerAccessTokenWithResponse(String resourceGroupName, + String accountName, GenerateExtensionRestrictedViewerAccessTokenParameters parameters, Context context); + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccessTokenInner extensionRestrictedViewerAccessToken(String resourceGroupName, String accountName); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/OperationsClient.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/OperationsClient.java new file mode 100644 index 000000000000..52ef4f762b93 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/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.vi.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.vi.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * Lists all of the available Azure Video Indexer provider 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 available operations of the service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available Azure Video Indexer provider 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 available operations of the service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/PrivateEndpointConnectionsClient.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..37dbb5602c63 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.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.vi.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 Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * List all private endpoint connections in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount(String resourceGroupName, String accountName, + Context context); + + /** + * Get the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Video Indexer account along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context); + + /** + * Get the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Video Indexer account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get(String resourceGroupName, String accountName, + String privateEndpointConnectionName); + + /** + * Update the state of specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner body); + + /** + * Update the state of specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner body, Context context); + + /** + * Update the state of specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String accountName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner body); + + /** + * Update the state of specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String accountName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner body, Context context); + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/PrivateLinkResourcesClient.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 000000000000..b1c18a2f4b2a --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/PrivateLinkResourcesClient.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.vi.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.util.Context; +import com.azure.resourcemanager.vi.fluent.models.PrivateLinkResourceInner; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ +public interface PrivateLinkResourcesClient { + /** + * List all private link resources in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * List all private link resources in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount(String resourceGroupName, String accountName, + Context context); + + /** + * Get the private link resource with the specified group Id associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param groupId The group ID 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 the private link resource with the specified group Id associated with the Video Indexer account along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String groupId, + Context context); + + /** + * Get the private link resource with the specified group Id associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param groupId The group ID 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 the private link resource with the specified group Id associated with the Video Indexer account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String accountName, String groupId); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/ViManagementClient.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/ViManagementClient.java new file mode 100644 index 000000000000..a08720c78d4f --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/ViManagementClient.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.vi.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for ViManagementClient class. + */ +public interface ViManagementClient { + /** + * Gets The ID of the target subscription. + * + * @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 OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the AccountsClient object to access its operations. + * + * @return the AccountsClient object. + */ + AccountsClient getAccounts(); + + /** + * Gets the GeneratesClient object to access its operations. + * + * @return the GeneratesClient object. + */ + GeneratesClient getGenerates(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccessTokenInner.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccessTokenInner.java new file mode 100644 index 000000000000..50a2820c3a5c --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccessTokenInner.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.vi.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure Video Indexer access token. + */ +@Immutable +public final class AccessTokenInner implements JsonSerializable { + /* + * The access token. + */ + private String accessToken; + + /** + * Creates an instance of AccessTokenInner class. + */ + public AccessTokenInner() { + } + + /** + * Get the accessToken property: The access token. + * + * @return the accessToken value. + */ + public String accessToken() { + return this.accessToken; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessTokenInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessTokenInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessTokenInner. + */ + public static AccessTokenInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessTokenInner deserializedAccessTokenInner = new AccessTokenInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accessToken".equals(fieldName)) { + deserializedAccessTokenInner.accessToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessTokenInner; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccountInner.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccountInner.java new file mode 100644 index 000000000000..74d287b9e2ff --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccountInner.java @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.vi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.vi.models.OpenAiServicesForPutRequest; +import com.azure.resourcemanager.vi.models.ProvisioningState; +import com.azure.resourcemanager.vi.models.PublicNetworkAccess; +import com.azure.resourcemanager.vi.models.StorageServicesForPutRequest; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * An Azure Video Indexer account. + */ +@Fluent +public final class AccountInner extends Resource { + /* + * List of account properties + */ + private AccountPropertiesForPutRequest innerProperties; + + /* + * Managed service identity (system assigned and/or user assigned identities) + */ + private ManagedServiceIdentity identity; + + /* + * The system meta data relating to this resource. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AccountInner class. + */ + public AccountInner() { + } + + /** + * Get the innerProperties property: List of account properties. + * + * @return the innerProperties value. + */ + private AccountPropertiesForPutRequest innerProperties() { + return this.innerProperties; + } + + /** + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @param identity the identity value to set. + * @return the AccountInner object itself. + */ + public AccountInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the tenantId property: The account's tenant id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Get the accountId property: The account's data-plane ID. This can be set only when connecting an existing classic + * account. + * + * @return the accountId value. + */ + public String accountId() { + return this.innerProperties() == null ? null : this.innerProperties().accountId(); + } + + /** + * Set the accountId property: The account's data-plane ID. This can be set only when connecting an existing classic + * account. + * + * @param accountId the accountId value to set. + * @return the AccountInner object itself. + */ + public AccountInner withAccountId(String accountId) { + if (this.innerProperties() == null) { + this.innerProperties = new AccountPropertiesForPutRequest(); + } + this.innerProperties().withAccountId(accountId); + return this; + } + + /** + * Get the accountName property: The account's name. + * + * @return the accountName value. + */ + public String accountName() { + return this.innerProperties() == null ? null : this.innerProperties().accountName(); + } + + /** + * Get the storageServices property: The storage services details. + * + * @return the storageServices value. + */ + public StorageServicesForPutRequest storageServices() { + return this.innerProperties() == null ? null : this.innerProperties().storageServices(); + } + + /** + * Set the storageServices property: The storage services details. + * + * @param storageServices the storageServices value to set. + * @return the AccountInner object itself. + */ + public AccountInner withStorageServices(StorageServicesForPutRequest storageServices) { + if (this.innerProperties() == null) { + this.innerProperties = new AccountPropertiesForPutRequest(); + } + this.innerProperties().withStorageServices(storageServices); + return this; + } + + /** + * Get the openAiServices property: The openAi services details. + * + * @return the openAiServices value. + */ + public OpenAiServicesForPutRequest openAiServices() { + return this.innerProperties() == null ? null : this.innerProperties().openAiServices(); + } + + /** + * Set the openAiServices property: The openAi services details. + * + * @param openAiServices the openAiServices value to set. + * @return the AccountInner object itself. + */ + public AccountInner withOpenAiServices(OpenAiServicesForPutRequest openAiServices) { + if (this.innerProperties() == null) { + this.innerProperties = new AccountPropertiesForPutRequest(); + } + this.innerProperties().withOpenAiServices(openAiServices); + return this; + } + + /** + * Get the totalSecondsIndexed property: An integer representing the total seconds that have been indexed on the + * account. + * + * @return the totalSecondsIndexed value. + */ + public Integer totalSecondsIndexed() { + return this.innerProperties() == null ? null : this.innerProperties().totalSecondsIndexed(); + } + + /** + * Get the totalMinutesIndexed property: An integer representing the total minutes that have been indexed on the + * account. + * + * @return the totalMinutesIndexed value. + */ + public Long totalMinutesIndexed() { + return this.innerProperties() == null ? null : this.innerProperties().totalMinutesIndexed(); + } + + /** + * Get the publicNetworkAccess property: Whether or not public network access is allowed for the account. + * + * @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 account. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the AccountInner object itself. + */ + public AccountInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new AccountPropertiesForPutRequest(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections associated with the account. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Set the privateEndpointConnections property: List of private endpoint connections associated with the account. + * + * @param privateEndpointConnections the privateEndpointConnections value to set. + * @return the AccountInner object itself. + */ + public AccountInner + withPrivateEndpointConnections(List privateEndpointConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new AccountPropertiesForPutRequest(); + } + this.innerProperties().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + + /** + * Get the provisioningState property: Gets the status of the account 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(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AccountInner. + */ + public static AccountInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountInner deserializedAccountInner = new AccountInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAccountInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAccountInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAccountInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAccountInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAccountInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedAccountInner.innerProperties = AccountPropertiesForPutRequest.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedAccountInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAccountInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountInner; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccountPropertiesForPatchRequest.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccountPropertiesForPatchRequest.java new file mode 100644 index 000000000000..5833926acedb --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccountPropertiesForPatchRequest.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.vi.models.OpenAiServicesForPatchRequest; +import com.azure.resourcemanager.vi.models.ProvisioningState; +import com.azure.resourcemanager.vi.models.PublicNetworkAccess; +import com.azure.resourcemanager.vi.models.StorageServicesForPatchRequest; +import java.io.IOException; +import java.util.List; + +/** + * Azure Video Indexer account properties. + */ +@Fluent +public final class AccountPropertiesForPatchRequest implements JsonSerializable { + /* + * The account's tenant id + */ + private String tenantId; + + /* + * The account's data-plane ID + */ + private String accountId; + + /* + * The storage services details + */ + private StorageServicesForPatchRequest storageServices; + + /* + * The openAi services details + */ + private OpenAiServicesForPatchRequest openAiServices; + + /* + * Whether or not public network access is allowed for the account. + */ + private PublicNetworkAccess publicNetworkAccess; + + /* + * List of private endpoint connections associated with the account. + */ + private List privateEndpointConnections; + + /* + * Gets the status of the account at the time the operation was called. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of AccountPropertiesForPatchRequest class. + */ + public AccountPropertiesForPatchRequest() { + } + + /** + * Get the tenantId property: The account's tenant id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the accountId property: The account's data-plane ID. + * + * @return the accountId value. + */ + public String accountId() { + return this.accountId; + } + + /** + * Get the storageServices property: The storage services details. + * + * @return the storageServices value. + */ + public StorageServicesForPatchRequest storageServices() { + return this.storageServices; + } + + /** + * Set the storageServices property: The storage services details. + * + * @param storageServices the storageServices value to set. + * @return the AccountPropertiesForPatchRequest object itself. + */ + public AccountPropertiesForPatchRequest withStorageServices(StorageServicesForPatchRequest storageServices) { + this.storageServices = storageServices; + return this; + } + + /** + * Get the openAiServices property: The openAi services details. + * + * @return the openAiServices value. + */ + public OpenAiServicesForPatchRequest openAiServices() { + return this.openAiServices; + } + + /** + * Set the openAiServices property: The openAi services details. + * + * @param openAiServices the openAiServices value to set. + * @return the AccountPropertiesForPatchRequest object itself. + */ + public AccountPropertiesForPatchRequest withOpenAiServices(OpenAiServicesForPatchRequest openAiServices) { + this.openAiServices = openAiServices; + return this; + } + + /** + * Get the publicNetworkAccess property: Whether or not public network access is allowed for the account. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Whether or not public network access is allowed for the account. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the AccountPropertiesForPatchRequest object itself. + */ + public AccountPropertiesForPatchRequest withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections associated with the account. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Set the privateEndpointConnections property: List of private endpoint connections associated with the account. + * + * @param privateEndpointConnections the privateEndpointConnections value to set. + * @return the AccountPropertiesForPatchRequest object itself. + */ + public AccountPropertiesForPatchRequest + withPrivateEndpointConnections(List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** + * Get the provisioningState property: Gets the status of the account 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 (storageServices() != null) { + storageServices().validate(); + } + if (openAiServices() != null) { + openAiServices().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("storageServices", this.storageServices); + jsonWriter.writeJsonField("openAiServices", this.openAiServices); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeArrayField("privateEndpointConnections", this.privateEndpointConnections, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountPropertiesForPatchRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountPropertiesForPatchRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccountPropertiesForPatchRequest. + */ + public static AccountPropertiesForPatchRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountPropertiesForPatchRequest deserializedAccountPropertiesForPatchRequest + = new AccountPropertiesForPatchRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedAccountPropertiesForPatchRequest.tenantId = reader.getString(); + } else if ("accountId".equals(fieldName)) { + deserializedAccountPropertiesForPatchRequest.accountId = reader.getString(); + } else if ("storageServices".equals(fieldName)) { + deserializedAccountPropertiesForPatchRequest.storageServices + = StorageServicesForPatchRequest.fromJson(reader); + } else if ("openAiServices".equals(fieldName)) { + deserializedAccountPropertiesForPatchRequest.openAiServices + = OpenAiServicesForPatchRequest.fromJson(reader); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedAccountPropertiesForPatchRequest.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedAccountPropertiesForPatchRequest.privateEndpointConnections + = privateEndpointConnections; + } else if ("provisioningState".equals(fieldName)) { + deserializedAccountPropertiesForPatchRequest.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountPropertiesForPatchRequest; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccountPropertiesForPutRequest.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccountPropertiesForPutRequest.java new file mode 100644 index 000000000000..2ec1457f8d67 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/AccountPropertiesForPutRequest.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.vi.models.OpenAiServicesForPutRequest; +import com.azure.resourcemanager.vi.models.ProvisioningState; +import com.azure.resourcemanager.vi.models.PublicNetworkAccess; +import com.azure.resourcemanager.vi.models.StorageServicesForPutRequest; +import java.io.IOException; +import java.util.List; + +/** + * Azure Video Indexer account properties. + */ +@Fluent +public final class AccountPropertiesForPutRequest implements JsonSerializable { + /* + * The account's tenant id + */ + private String tenantId; + + /* + * The account's data-plane ID. This can be set only when connecting an existing classic account + */ + private String accountId; + + /* + * The account's name + */ + private String accountName; + + /* + * The storage services details + */ + private StorageServicesForPutRequest storageServices; + + /* + * The openAi services details + */ + private OpenAiServicesForPutRequest openAiServices; + + /* + * An integer representing the total seconds that have been indexed on the account + */ + private Integer totalSecondsIndexed; + + /* + * An integer representing the total minutes that have been indexed on the account + */ + private Long totalMinutesIndexed; + + /* + * Whether or not public network access is allowed for the account. + */ + private PublicNetworkAccess publicNetworkAccess; + + /* + * List of private endpoint connections associated with the account. + */ + private List privateEndpointConnections; + + /* + * Gets the status of the account at the time the operation was called. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of AccountPropertiesForPutRequest class. + */ + public AccountPropertiesForPutRequest() { + } + + /** + * Get the tenantId property: The account's tenant id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the accountId property: The account's data-plane ID. This can be set only when connecting an existing classic + * account. + * + * @return the accountId value. + */ + public String accountId() { + return this.accountId; + } + + /** + * Set the accountId property: The account's data-plane ID. This can be set only when connecting an existing classic + * account. + * + * @param accountId the accountId value to set. + * @return the AccountPropertiesForPutRequest object itself. + */ + public AccountPropertiesForPutRequest withAccountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Get the accountName property: The account's name. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Get the storageServices property: The storage services details. + * + * @return the storageServices value. + */ + public StorageServicesForPutRequest storageServices() { + return this.storageServices; + } + + /** + * Set the storageServices property: The storage services details. + * + * @param storageServices the storageServices value to set. + * @return the AccountPropertiesForPutRequest object itself. + */ + public AccountPropertiesForPutRequest withStorageServices(StorageServicesForPutRequest storageServices) { + this.storageServices = storageServices; + return this; + } + + /** + * Get the openAiServices property: The openAi services details. + * + * @return the openAiServices value. + */ + public OpenAiServicesForPutRequest openAiServices() { + return this.openAiServices; + } + + /** + * Set the openAiServices property: The openAi services details. + * + * @param openAiServices the openAiServices value to set. + * @return the AccountPropertiesForPutRequest object itself. + */ + public AccountPropertiesForPutRequest withOpenAiServices(OpenAiServicesForPutRequest openAiServices) { + this.openAiServices = openAiServices; + return this; + } + + /** + * Get the totalSecondsIndexed property: An integer representing the total seconds that have been indexed on the + * account. + * + * @return the totalSecondsIndexed value. + */ + public Integer totalSecondsIndexed() { + return this.totalSecondsIndexed; + } + + /** + * Get the totalMinutesIndexed property: An integer representing the total minutes that have been indexed on the + * account. + * + * @return the totalMinutesIndexed value. + */ + public Long totalMinutesIndexed() { + return this.totalMinutesIndexed; + } + + /** + * Get the publicNetworkAccess property: Whether or not public network access is allowed for the account. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Whether or not public network access is allowed for the account. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the AccountPropertiesForPutRequest object itself. + */ + public AccountPropertiesForPutRequest withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections associated with the account. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Set the privateEndpointConnections property: List of private endpoint connections associated with the account. + * + * @param privateEndpointConnections the privateEndpointConnections value to set. + * @return the AccountPropertiesForPutRequest object itself. + */ + public AccountPropertiesForPutRequest + withPrivateEndpointConnections(List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** + * Get the provisioningState property: Gets the status of the account 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 (storageServices() != null) { + storageServices().validate(); + } + if (openAiServices() != null) { + openAiServices().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accountId", this.accountId); + jsonWriter.writeJsonField("storageServices", this.storageServices); + jsonWriter.writeJsonField("openAiServices", this.openAiServices); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeArrayField("privateEndpointConnections", this.privateEndpointConnections, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountPropertiesForPutRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountPropertiesForPutRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccountPropertiesForPutRequest. + */ + public static AccountPropertiesForPutRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountPropertiesForPutRequest deserializedAccountPropertiesForPutRequest + = new AccountPropertiesForPutRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedAccountPropertiesForPutRequest.tenantId = reader.getString(); + } else if ("accountId".equals(fieldName)) { + deserializedAccountPropertiesForPutRequest.accountId = reader.getString(); + } else if ("accountName".equals(fieldName)) { + deserializedAccountPropertiesForPutRequest.accountName = reader.getString(); + } else if ("storageServices".equals(fieldName)) { + deserializedAccountPropertiesForPutRequest.storageServices + = StorageServicesForPutRequest.fromJson(reader); + } else if ("openAiServices".equals(fieldName)) { + deserializedAccountPropertiesForPutRequest.openAiServices + = OpenAiServicesForPutRequest.fromJson(reader); + } else if ("totalSecondsIndexed".equals(fieldName)) { + deserializedAccountPropertiesForPutRequest.totalSecondsIndexed + = reader.getNullable(JsonReader::getInt); + } else if ("totalMinutesIndexed".equals(fieldName)) { + deserializedAccountPropertiesForPutRequest.totalMinutesIndexed + = reader.getNullable(JsonReader::getLong); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedAccountPropertiesForPutRequest.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedAccountPropertiesForPutRequest.privateEndpointConnections = privateEndpointConnections; + } else if ("provisioningState".equals(fieldName)) { + deserializedAccountPropertiesForPutRequest.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountPropertiesForPutRequest; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/CheckNameAvailabilityResultInner.java new file mode 100644 index 000000000000..a197fe8e40ca --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/CheckNameAvailabilityResultInner.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.vi.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.vi.models.Reason; +import java.io.IOException; + +/** + * The CheckNameAvailability operation response. + */ +@Immutable +public final class CheckNameAvailabilityResultInner implements JsonSerializable { + /* + * Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. + * If false, the name has already been taken. + */ + private Boolean nameAvailable; + + /* + * Gets the reason that a Video Indexer account name could not be used. The Reason element is only returned if + * NameAvailable is false. + */ + private Reason reason; + + /* + * Gets an error message explaining the Reason value in more detail. + */ + private String message; + + /** + * Creates an instance of CheckNameAvailabilityResultInner class. + */ + public CheckNameAvailabilityResultInner() { + } + + /** + * Get the nameAvailable property: Gets a boolean value that indicates whether the name is available for you to use. + * If true, the name is available. If false, the name has already been taken. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason property: Gets the reason that a Video Indexer account name could not be used. The Reason element + * is only returned if NameAvailable is false. + * + * @return the reason value. + */ + public Reason reason() { + return this.reason; + } + + /** + * Get the message property: Gets an error message explaining the Reason value in more detail. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CheckNameAvailabilityResultInner. + */ + public static CheckNameAvailabilityResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityResultInner deserializedCheckNameAvailabilityResultInner + = new CheckNameAvailabilityResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedCheckNameAvailabilityResultInner.nameAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("reason".equals(fieldName)) { + deserializedCheckNameAvailabilityResultInner.reason = Reason.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedCheckNameAvailabilityResultInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityResultInner; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/OperationInner.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/OperationInner.java new file mode 100644 index 000000000000..e574f65f0106 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/OperationInner.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.vi.models.OperationDisplay; +import java.io.IOException; + +/** + * Operation detail payload. + */ +@Immutable +public final class OperationInner implements JsonSerializable { + /* + * Name of the operation + */ + private String name; + + /* + * Indicates whether the operation is a data action + */ + private Boolean isDataAction; + + /* + * Indicates the action type. + */ + private String actionType; + + /* + * Display of the operation + */ + private OperationDisplay display; + + /* + * Origin of the operation + */ + private String origin; + + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * Get the name property: Name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the actionType property: Indicates the action type. + * + * @return the actionType value. + */ + public String actionType() { + return this.actionType; + } + + /** + * Get the display property: Display of the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = reader.getString(); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateEndpointConnectionInner.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..cbe239bd1faa --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.vi.models.PrivateEndpoint; +import com.azure.resourcemanager.vi.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.vi.models.PrivateLinkServiceConnectionState; +import java.io.IOException; +import java.util.List; + +/** + * The private endpoint connection resource. + */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Resource properties. + */ + private PrivateEndpointConnectionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PrivateEndpointConnectionInner class. + */ + public PrivateEndpointConnectionInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.innerProperties() == null ? null : this.innerProperties().groupIds(); + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The private endpoint resource. + * + * @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 the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @param provisioningState the provisioningState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner + withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionInner. + */ + public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner + = new PrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..01ae999f9dd7 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.vi.models.PrivateEndpoint; +import com.azure.resourcemanager.vi.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.vi.models.PrivateLinkServiceConnectionState; +import java.io.IOException; +import java.util.List; + +/** + * Properties of the private endpoint connection. + */ +@Fluent +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { + /* + * The group ids for the private endpoint resource. + */ + private List groupIds; + + /* + * The private endpoint resource. + */ + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Creates an instance of PrivateEndpointConnectionProperties class. + */ + public PrivateEndpointConnectionProperties() { + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The private endpoint resource. + * + * @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 the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @param provisioningState the provisioningState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties + withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + jsonWriter.writeStringField("provisioningState", + this.provisioningState == null ? null : this.provisioningState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("groupIds".equals(fieldName)) { + List groupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateEndpointConnectionProperties.groupIds = groupIds; + } else if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateLinkResourceInner.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..37d49508fb00 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateLinkResourceInner.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.vi.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A private link resource. + */ +@Fluent +public final class PrivateLinkResourceInner extends ProxyResource { + /* + * Resource properties. + */ + private PrivateLinkResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PrivateLinkResourceInner class. + */ + public PrivateLinkResourceInner() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateLinkResourceInner. + */ + public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceInner deserializedPrivateLinkResourceInner = new PrivateLinkResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkResourceInner.innerProperties + = PrivateLinkResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceInner; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateLinkResourceProperties.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..fbea4bb0cd05 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of a private link resource. + */ +@Fluent +public final class PrivateLinkResourceProperties implements JsonSerializable { + /* + * The private link resource group id. + */ + private String groupId; + + /* + * The private link resource required member names. + */ + private List requiredMembers; + + /* + * The private link resource private link DNS zone name. + */ + private List requiredZoneNames; + + /** + * Creates an instance of PrivateLinkResourceProperties class. + */ + public PrivateLinkResourceProperties() { + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * 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() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/package-info.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/package-info.java new file mode 100644 index 000000000000..ff7f497a887d --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// 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 ViManagementClient. + * Microsoft Azure Video Indexer. + */ +package com.azure.resourcemanager.vi.fluent.models; diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/package-info.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/package-info.java new file mode 100644 index 000000000000..e08751f53f40 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/fluent/package-info.java @@ -0,0 +1,9 @@ +// 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 ViManagementClient. + * Microsoft Azure Video Indexer. + */ +package com.azure.resourcemanager.vi.fluent; diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccessTokenImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccessTokenImpl.java new file mode 100644 index 000000000000..b477a4813af3 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccessTokenImpl.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.vi.implementation; + +import com.azure.resourcemanager.vi.fluent.models.AccessTokenInner; +import com.azure.resourcemanager.vi.models.AccessToken; + +public final class AccessTokenImpl implements AccessToken { + private AccessTokenInner innerObject; + + private final com.azure.resourcemanager.vi.ViManager serviceManager; + + AccessTokenImpl(AccessTokenInner innerObject, com.azure.resourcemanager.vi.ViManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String accessToken() { + return this.innerModel().accessToken(); + } + + public AccessTokenInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.vi.ViManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccountImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccountImpl.java new file mode 100644 index 000000000000..387c0ca7e2f9 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccountImpl.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.vi.fluent.models.AccountInner; +import com.azure.resourcemanager.vi.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.vi.models.Account; +import com.azure.resourcemanager.vi.models.AccountPatch; +import com.azure.resourcemanager.vi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.vi.models.OpenAiServicesForPatchRequest; +import com.azure.resourcemanager.vi.models.OpenAiServicesForPutRequest; +import com.azure.resourcemanager.vi.models.PrivateEndpointConnection; +import com.azure.resourcemanager.vi.models.ProvisioningState; +import com.azure.resourcemanager.vi.models.PublicNetworkAccess; +import com.azure.resourcemanager.vi.models.StorageServicesForPatchRequest; +import com.azure.resourcemanager.vi.models.StorageServicesForPutRequest; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class AccountImpl implements Account, Account.Definition, Account.Update { + private AccountInner innerObject; + + private final com.azure.resourcemanager.vi.ViManager 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 ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public String accountId() { + return this.innerModel().accountId(); + } + + public String accountName() { + return this.innerModel().accountName(); + } + + public StorageServicesForPutRequest storageServices() { + return this.innerModel().storageServices(); + } + + public OpenAiServicesForPutRequest openAiServices() { + return this.innerModel().openAiServices(); + } + + public Integer totalSecondsIndexed() { + return this.innerModel().totalSecondsIndexed(); + } + + public Long totalMinutesIndexed() { + return this.innerModel().totalMinutesIndexed(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + 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 ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AccountInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.vi.ViManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private AccountPatch updateParameters; + + public AccountImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Account create() { + this.innerObject = serviceManager.serviceClient() + .getAccounts() + .createOrUpdateWithResponse(resourceGroupName, accountName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Account create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAccounts() + .createOrUpdateWithResponse(resourceGroupName, accountName, this.innerModel(), context) + .getValue(); + return this; + } + + AccountImpl(String name, com.azure.resourcemanager.vi.ViManager serviceManager) { + this.innerObject = new AccountInner(); + this.serviceManager = serviceManager; + this.accountName = name; + } + + public AccountImpl update() { + this.updateParameters = new AccountPatch(); + return this; + } + + public Account apply() { + this.innerObject = serviceManager.serviceClient() + .getAccounts() + .updateWithResponse(resourceGroupName, accountName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Account apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAccounts() + .updateWithResponse(resourceGroupName, accountName, updateParameters, context) + .getValue(); + return this; + } + + AccountImpl(AccountInner innerObject, com.azure.resourcemanager.vi.ViManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); + } + + public Account refresh() { + this.innerObject = serviceManager.serviceClient() + .getAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE) + .getValue(); + return this; + } + + public Account refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, context) + .getValue(); + return this; + } + + public AccountImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AccountImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AccountImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public AccountImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + + public AccountImpl withAccountId(String accountId) { + this.innerModel().withAccountId(accountId); + return this; + } + + public AccountImpl withStorageServices(StorageServicesForPutRequest storageServices) { + this.innerModel().withStorageServices(storageServices); + return this; + } + + public AccountImpl withOpenAiServices(OpenAiServicesForPutRequest openAiServices) { + this.innerModel().withOpenAiServices(openAiServices); + return this; + } + + public AccountImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (isInCreateMode()) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } else { + this.updateParameters.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + } + + public AccountImpl withPrivateEndpointConnections(List privateEndpointConnections) { + if (isInCreateMode()) { + this.innerModel().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } else { + this.updateParameters.withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + } + + public AccountImpl withStorageServices(StorageServicesForPatchRequest storageServices) { + this.updateParameters.withStorageServices(storageServices); + return this; + } + + public AccountImpl withOpenAiServices(OpenAiServicesForPatchRequest openAiServices) { + this.updateParameters.withOpenAiServices(openAiServices); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccountsClientImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccountsClientImpl.java new file mode 100644 index 000000000000..bbce3da66731 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccountsClientImpl.java @@ -0,0 +1,1113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.vi.fluent.AccountsClient; +import com.azure.resourcemanager.vi.fluent.models.AccountInner; +import com.azure.resourcemanager.vi.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.vi.models.AccountCheckNameAvailabilityParameters; +import com.azure.resourcemanager.vi.models.AccountList; +import com.azure.resourcemanager.vi.models.AccountPatch; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AccountsClient. + */ +public final class AccountsClientImpl implements AccountsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AccountsService service; + + /** + * The service client containing this operation class. + */ + private final ViManagementClientImpl client; + + /** + * Initializes an instance of AccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccountsClientImpl(ViManagementClientImpl client) { + this.service = RestProxy.create(AccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ViManagementClientAccounts to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ViManagementClientAc") + public interface AccountsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.VideoIndexer/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AccountCheckNameAvailabilityParameters checkNameAvailabilityParameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.VideoIndexer/accounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts/{accountName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts/{accountName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") AccountPatch parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts/{accountName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") AccountInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts/{accountName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Checks that the Video Indexer account name is valid and is not already in use. + * + * @param checkNameAvailabilityParameters The name of the Video Indexer account. Name must be unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + checkNameAvailabilityWithResponseAsync(AccountCheckNameAvailabilityParameters checkNameAvailabilityParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (checkNameAvailabilityParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter checkNameAvailabilityParameters is required and cannot be null.")); + } else { + checkNameAvailabilityParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.checkNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), checkNameAvailabilityParameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the Video Indexer account name is valid and is not already in use. + * + * @param checkNameAvailabilityParameters The name of the Video Indexer account. Name must be unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + AccountCheckNameAvailabilityParameters checkNameAvailabilityParameters, 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 (checkNameAvailabilityParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter checkNameAvailabilityParameters is required and cannot be null.")); + } else { + checkNameAvailabilityParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.checkNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), + this.client.getApiVersion(), checkNameAvailabilityParameters, accept, context); + } + + /** + * Checks that the Video Indexer account name is valid and is not already in use. + * + * @param checkNameAvailabilityParameters The name of the Video Indexer account. Name must be unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + checkNameAvailabilityAsync(AccountCheckNameAvailabilityParameters checkNameAvailabilityParameters) { + return checkNameAvailabilityWithResponseAsync(checkNameAvailabilityParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks that the Video Indexer account name is valid and is not already in use. + * + * @param checkNameAvailabilityParameters The name of the Video Indexer account. Name must be unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + AccountCheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context) { + return checkNameAvailabilityWithResponseAsync(checkNameAvailabilityParameters, context).block(); + } + + /** + * Checks that the Video Indexer account name is valid and is not already in use. + * + * @param checkNameAvailabilityParameters The name of the Video Indexer account. Name must be unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResultInner + checkNameAvailability(AccountCheckNameAvailabilityParameters checkNameAvailabilityParameters) { + return checkNameAvailabilityWithResponse(checkNameAvailabilityParameters, Context.NONE).getValue(); + } + + /** + * List all Azure Video Indexer accounts available under the 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 list operation response, that contains the data pools and their properties 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.getSubscriptionId(), + 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())); + } + + /** + * List all Azure Video Indexer accounts available under the 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 list operation response, that contains the data pools and their properties 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.getSubscriptionId(), this.client.getApiVersion(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all Azure Video Indexer accounts available under the 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 list operation response, that contains the data pools and their properties as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all Azure Video Indexer accounts available under the 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 list operation response, that contains the data pools and their properties as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Azure Video Indexer accounts available under the 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 list operation response, that contains the data pools and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List all Azure Video Indexer accounts available under the 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 list operation response, that contains the data pools and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List all Azure Video Indexer accounts available under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation response, that contains the data pools and their properties 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.getSubscriptionId(), resourceGroupName, 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())); + } + + /** + * List all Azure Video Indexer accounts available under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation response, that contains the data pools and their properties 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.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all Azure Video Indexer accounts available under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation response, that contains the data pools and their properties as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all Azure Video Indexer accounts available under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation response, that contains the data pools and their properties 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)); + } + + /** + * List all Azure Video Indexer accounts available under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation response, that contains the data pools and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List all Azure Video Indexer accounts available under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation response, that contains the data pools and their properties 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 an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an Azure Video Indexer account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an Azure Video Indexer account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String accountName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, this.client.getApiVersion(), accept, context); + } + + /** + * Gets the properties of an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an Azure Video Indexer account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the properties of an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an Azure Video Indexer account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Gets the properties of an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an Azure Video Indexer account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + /** + * Updates the properties of an existing Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters to provide for the current Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Video Indexer account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, + AccountPatch 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the properties of an existing Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters to provide for the current Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Video Indexer account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, + AccountPatch 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Updates the properties of an existing Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Video Indexer account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String accountName) { + final AccountPatch parameters = null; + return updateWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates the properties of an existing Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters to provide for the current Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Video Indexer account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String accountName, + AccountPatch parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Updates the properties of an existing Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Video Indexer account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountInner update(String resourceGroupName, String accountName) { + final AccountPatch parameters = null; + return updateWithResponse(resourceGroupName, accountName, parameters, Context.NONE).getValue(); + } + + /** + * Creates or updates an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters to provide for the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Video Indexer account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, + AccountInner 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters to provide for the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Video Indexer account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, + AccountInner 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Creates or updates an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Video Indexer account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName) { + final AccountInner parameters = null; + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters to provide for the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Video Indexer account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + AccountInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Creates or updates an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Video Indexer account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountInner createOrUpdate(String resourceGroupName, String accountName) { + final AccountInner parameters = null; + return createOrUpdateWithResponse(resourceGroupName, accountName, parameters, Context.NONE).getValue(); + } + + /** + * Delete an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 accountName, + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, this.client.getApiVersion(), accept, context); + } + + /** + * Delete an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 accountName) { + return deleteWithResponseAsync(resourceGroupName, accountName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String accountName, Context context) { + return deleteWithResponseAsync(resourceGroupName, accountName, context).block(); + } + + /** + * Delete an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 accountName) { + deleteWithResponse(resourceGroupName, accountName, Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation response, that contains the data pools and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation response, that contains the data pools and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation response, that contains the data pools and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation response, that contains the data pools and their properties 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)); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccountsImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccountsImpl.java new file mode 100644 index 000000000000..bfae852a9b8d --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/AccountsImpl.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.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.vi.fluent.AccountsClient; +import com.azure.resourcemanager.vi.fluent.models.AccountInner; +import com.azure.resourcemanager.vi.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.vi.models.Account; +import com.azure.resourcemanager.vi.models.AccountCheckNameAvailabilityParameters; +import com.azure.resourcemanager.vi.models.Accounts; +import com.azure.resourcemanager.vi.models.CheckNameAvailabilityResult; + +public final class AccountsImpl implements Accounts { + private static final ClientLogger LOGGER = new ClientLogger(AccountsImpl.class); + + private final AccountsClient innerClient; + + private final com.azure.resourcemanager.vi.ViManager serviceManager; + + public AccountsImpl(AccountsClient innerClient, com.azure.resourcemanager.vi.ViManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response checkNameAvailabilityWithResponse( + AccountCheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context) { + Response inner + = this.serviceClient().checkNameAvailabilityWithResponse(checkNameAvailabilityParameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckNameAvailabilityResult + checkNameAvailability(AccountCheckNameAvailabilityParameters checkNameAvailabilityParameters) { + CheckNameAvailabilityResultInner inner + = this.serviceClient().checkNameAvailability(checkNameAvailabilityParameters); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accountName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccountImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Account getByResourceGroup(String resourceGroupName, String accountName) { + AccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, accountName); + if (inner != null) { + return new AccountImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String accountName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String accountName) { + this.serviceClient().delete(resourceGroupName, accountName); + } + + public Account getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, accountName, context); + } + + private AccountsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.vi.ViManager manager() { + return this.serviceManager; + } + + public AccountImpl define(String name) { + return new AccountImpl(name, this.manager()); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/CheckNameAvailabilityResultImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 000000000000..84ac2d135777 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/CheckNameAvailabilityResultImpl.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.vi.implementation; + +import com.azure.resourcemanager.vi.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.vi.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.vi.models.Reason; + +public final class CheckNameAvailabilityResultImpl implements CheckNameAvailabilityResult { + private CheckNameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.vi.ViManager serviceManager; + + CheckNameAvailabilityResultImpl(CheckNameAvailabilityResultInner innerObject, + com.azure.resourcemanager.vi.ViManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public Reason reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.vi.ViManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/GeneratesClientImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/GeneratesClientImpl.java new file mode 100644 index 000000000000..fe225413fe9d --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/GeneratesClientImpl.java @@ -0,0 +1,635 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +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.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.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.vi.fluent.GeneratesClient; +import com.azure.resourcemanager.vi.fluent.models.AccessTokenInner; +import com.azure.resourcemanager.vi.models.GenerateAccessTokenParameters; +import com.azure.resourcemanager.vi.models.GenerateExtensionAccessTokenParameters; +import com.azure.resourcemanager.vi.models.GenerateExtensionRestrictedViewerAccessTokenParameters; +import com.azure.resourcemanager.vi.models.GenerateRestrictedViewerAccessTokenParameters; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GeneratesClient. + */ +public final class GeneratesClientImpl implements GeneratesClient { + /** + * The proxy service used to perform REST calls. + */ + private final GeneratesService service; + + /** + * The service client containing this operation class. + */ + private final ViManagementClientImpl client; + + /** + * Initializes an instance of GeneratesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GeneratesClientImpl(ViManagementClientImpl client) { + this.service + = RestProxy.create(GeneratesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ViManagementClientGenerates to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ViManagementClientGe") + public interface GeneratesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts/{accountName}/generateAccessToken") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> accessToken(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GenerateAccessTokenParameters parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts/{accountName}/generateRestrictedViewerAccessToken") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> restrictedViewerAccessToken(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GenerateRestrictedViewerAccessTokenParameters parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts/{accountName}/generateExtensionAccessToken") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> extensionAccessToken(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GenerateExtensionAccessTokenParameters parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts/{accountName}/generateExtensionRestrictedViewerAccessToken") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> extensionRestrictedViewerAccessToken(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GenerateExtensionRestrictedViewerAccessTokenParameters parameters, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating access 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 azure Video Indexer access token along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> accessTokenWithResponseAsync(String resourceGroupName, String accountName, + GenerateAccessTokenParameters 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.accessToken(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating access 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 azure Video Indexer access token along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> accessTokenWithResponseAsync(String resourceGroupName, String accountName, + GenerateAccessTokenParameters 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.accessToken(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + accountName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono accessTokenAsync(String resourceGroupName, String accountName) { + final GenerateAccessTokenParameters parameters = null; + return accessTokenWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating access 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 azure Video Indexer access token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response accessTokenWithResponse(String resourceGroupName, String accountName, + GenerateAccessTokenParameters parameters, Context context) { + return accessTokenWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessTokenInner accessToken(String resourceGroupName, String accountName) { + final GenerateAccessTokenParameters parameters = null; + return accessTokenWithResponse(resourceGroupName, accountName, parameters, Context.NONE).getValue(); + } + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating restricted viewer access 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 azure Video Indexer access token along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> restrictedViewerAccessTokenWithResponseAsync(String resourceGroupName, + String accountName, GenerateRestrictedViewerAccessTokenParameters 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.restrictedViewerAccessToken(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), + parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating restricted viewer access 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 azure Video Indexer access token along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> restrictedViewerAccessTokenWithResponseAsync(String resourceGroupName, + String accountName, GenerateRestrictedViewerAccessTokenParameters 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.restrictedViewerAccessToken(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restrictedViewerAccessTokenAsync(String resourceGroupName, String accountName) { + final GenerateRestrictedViewerAccessTokenParameters parameters = null; + return restrictedViewerAccessTokenWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating restricted viewer access 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 azure Video Indexer access token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response restrictedViewerAccessTokenWithResponse(String resourceGroupName, + String accountName, GenerateRestrictedViewerAccessTokenParameters parameters, Context context) { + return restrictedViewerAccessTokenWithResponseAsync(resourceGroupName, accountName, parameters, context) + .block(); + } + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessTokenInner restrictedViewerAccessToken(String resourceGroupName, String accountName) { + final GenerateRestrictedViewerAccessTokenParameters parameters = null; + return restrictedViewerAccessTokenWithResponse(resourceGroupName, accountName, parameters, Context.NONE) + .getValue(); + } + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating access 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 azure Video Indexer access token along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> extensionAccessTokenWithResponseAsync(String resourceGroupName, + String accountName, GenerateExtensionAccessTokenParameters 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.extensionAccessToken(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating access 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 azure Video Indexer access token along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> extensionAccessTokenWithResponseAsync(String resourceGroupName, + String accountName, GenerateExtensionAccessTokenParameters 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.extensionAccessToken(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono extensionAccessTokenAsync(String resourceGroupName, String accountName) { + final GenerateExtensionAccessTokenParameters parameters = null; + return extensionAccessTokenWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating access 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 azure Video Indexer access token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response extensionAccessTokenWithResponse(String resourceGroupName, String accountName, + GenerateExtensionAccessTokenParameters parameters, Context context) { + return extensionAccessTokenWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); + } + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessTokenInner extensionAccessToken(String resourceGroupName, String accountName) { + final GenerateExtensionAccessTokenParameters parameters = null; + return extensionAccessTokenWithResponse(resourceGroupName, accountName, parameters, Context.NONE).getValue(); + } + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating restricted viewer access 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 azure Video Indexer access token along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> extensionRestrictedViewerAccessTokenWithResponseAsync( + String resourceGroupName, String accountName, + GenerateExtensionRestrictedViewerAccessTokenParameters 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.extensionRestrictedViewerAccessToken(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), + parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating restricted viewer access 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 azure Video Indexer access token along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> extensionRestrictedViewerAccessTokenWithResponseAsync( + String resourceGroupName, String accountName, GenerateExtensionRestrictedViewerAccessTokenParameters 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.extensionRestrictedViewerAccessToken(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, accountName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono extensionRestrictedViewerAccessTokenAsync(String resourceGroupName, + String accountName) { + final GenerateExtensionRestrictedViewerAccessTokenParameters parameters = null; + return extensionRestrictedViewerAccessTokenWithResponseAsync(resourceGroupName, accountName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating restricted viewer access 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 azure Video Indexer access token along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response extensionRestrictedViewerAccessTokenWithResponse(String resourceGroupName, + String accountName, GenerateExtensionRestrictedViewerAccessTokenParameters parameters, Context context) { + return extensionRestrictedViewerAccessTokenWithResponseAsync(resourceGroupName, accountName, parameters, + context).block(); + } + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccessTokenInner extensionRestrictedViewerAccessToken(String resourceGroupName, String accountName) { + final GenerateExtensionRestrictedViewerAccessTokenParameters parameters = null; + return extensionRestrictedViewerAccessTokenWithResponse(resourceGroupName, accountName, parameters, + Context.NONE).getValue(); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/GeneratesImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/GeneratesImpl.java new file mode 100644 index 000000000000..6a50d5a0fc1f --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/GeneratesImpl.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.vi.implementation; + +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.vi.fluent.GeneratesClient; +import com.azure.resourcemanager.vi.fluent.models.AccessTokenInner; +import com.azure.resourcemanager.vi.models.AccessToken; +import com.azure.resourcemanager.vi.models.GenerateAccessTokenParameters; +import com.azure.resourcemanager.vi.models.GenerateExtensionAccessTokenParameters; +import com.azure.resourcemanager.vi.models.GenerateExtensionRestrictedViewerAccessTokenParameters; +import com.azure.resourcemanager.vi.models.GenerateRestrictedViewerAccessTokenParameters; +import com.azure.resourcemanager.vi.models.Generates; + +public final class GeneratesImpl implements Generates { + private static final ClientLogger LOGGER = new ClientLogger(GeneratesImpl.class); + + private final GeneratesClient innerClient; + + private final com.azure.resourcemanager.vi.ViManager serviceManager; + + public GeneratesImpl(GeneratesClient innerClient, com.azure.resourcemanager.vi.ViManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response accessTokenWithResponse(String resourceGroupName, String accountName, + GenerateAccessTokenParameters parameters, Context context) { + Response inner + = this.serviceClient().accessTokenWithResponse(resourceGroupName, accountName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccessTokenImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessToken accessToken(String resourceGroupName, String accountName) { + AccessTokenInner inner = this.serviceClient().accessToken(resourceGroupName, accountName); + if (inner != null) { + return new AccessTokenImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response restrictedViewerAccessTokenWithResponse(String resourceGroupName, String accountName, + GenerateRestrictedViewerAccessTokenParameters parameters, Context context) { + Response inner = this.serviceClient() + .restrictedViewerAccessTokenWithResponse(resourceGroupName, accountName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccessTokenImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessToken restrictedViewerAccessToken(String resourceGroupName, String accountName) { + AccessTokenInner inner = this.serviceClient().restrictedViewerAccessToken(resourceGroupName, accountName); + if (inner != null) { + return new AccessTokenImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response extensionAccessTokenWithResponse(String resourceGroupName, String accountName, + GenerateExtensionAccessTokenParameters parameters, Context context) { + Response inner = this.serviceClient() + .extensionAccessTokenWithResponse(resourceGroupName, accountName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccessTokenImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessToken extensionAccessToken(String resourceGroupName, String accountName) { + AccessTokenInner inner = this.serviceClient().extensionAccessToken(resourceGroupName, accountName); + if (inner != null) { + return new AccessTokenImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response extensionRestrictedViewerAccessTokenWithResponse(String resourceGroupName, + String accountName, GenerateExtensionRestrictedViewerAccessTokenParameters parameters, Context context) { + Response inner = this.serviceClient() + .extensionRestrictedViewerAccessTokenWithResponse(resourceGroupName, accountName, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccessTokenImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccessToken extensionRestrictedViewerAccessToken(String resourceGroupName, String accountName) { + AccessTokenInner inner + = this.serviceClient().extensionRestrictedViewerAccessToken(resourceGroupName, accountName); + if (inner != null) { + return new AccessTokenImpl(inner, this.manager()); + } else { + return null; + } + } + + private GeneratesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.vi.ViManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/OperationImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/OperationImpl.java new file mode 100644 index 000000000000..8054cef85f09 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/OperationImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.implementation; + +import com.azure.resourcemanager.vi.fluent.models.OperationInner; +import com.azure.resourcemanager.vi.models.Operation; +import com.azure.resourcemanager.vi.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.vi.ViManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.vi.ViManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public String actionType() { + return this.innerModel().actionType(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.vi.ViManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/OperationsClientImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..17af2fa3a530 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/OperationsClientImpl.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.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.vi.fluent.OperationsClient; +import com.azure.resourcemanager.vi.fluent.models.OperationInner; +import com.azure.resourcemanager.vi.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 ViManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ViManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ViManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ViManagementClientOp") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.VideoIndexer/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 Video Indexer provider 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 available operations of the service 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 Video Indexer provider 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 available operations of the service 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 Video Indexer provider 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 available operations of the service 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 Video Indexer provider 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 available operations of the service 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 Video Indexer provider 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 available operations of the service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available Azure Video Indexer provider 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 available operations of the service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service 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/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/OperationsImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/OperationsImpl.java new file mode 100644 index 000000000000..c18db5dd6be3 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/OperationsImpl.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.vi.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.vi.fluent.OperationsClient; +import com.azure.resourcemanager.vi.fluent.models.OperationInner; +import com.azure.resourcemanager.vi.models.Operation; +import com.azure.resourcemanager.vi.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.vi.ViManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.vi.ViManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.vi.ViManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateEndpointConnectionImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..1953b1597fe1 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateEndpointConnectionImpl.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.vi.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.vi.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.vi.models.PrivateEndpoint; +import com.azure.resourcemanager.vi.models.PrivateEndpointConnection; +import com.azure.resourcemanager.vi.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.vi.models.PrivateLinkServiceConnectionState; +import java.util.Collections; +import java.util.List; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.vi.ViManager 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 List groupIds() { + List inner = this.innerModel().groupIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.vi.ViManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, accountName, privateEndpointConnectionName, this.innerModel(), + Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, accountName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl(String name, com.azure.resourcemanager.vi.ViManager 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, accountName, privateEndpointConnectionName, this.innerModel(), + Context.NONE); + return this; + } + + public PrivateEndpointConnection apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .createOrUpdate(resourceGroupName, accountName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.vi.ViManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); + this.privateEndpointConnectionName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); + } + + public PrivateEndpointConnection refresh() { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, accountName, 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; + } + + public PrivateEndpointConnectionImpl + withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..3aebfed8060b --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,978 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.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.vi.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.vi.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.vi.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 ViManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(ViManagementClientImpl client) { + this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ViManagementClientPrivateEndpointConnections to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ViManagementClientPr") + public interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts/{accountName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAccount(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts/{accountName}/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("accountName") String accountName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts/{accountName}/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("accountName") String accountName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List all private endpoint connections in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with the specified resource along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync(String resourceGroupName, + String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, 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 Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with the specified resource along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync(String resourceGroupName, + String accountName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByAccount(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, 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 Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with the specified resource as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listByAccountSinglePageAsync(resourceGroupName, accountName), + nextLink -> listByAccountNextSinglePageAsync(nextLink)); + } + + /** + * List all private endpoint connections in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with the specified resource as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listByAccountSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listByAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * List all private endpoint connections in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount(String resourceGroupName, String accountName) { + return new PagedIterable<>(listByAccountAsync(resourceGroupName, accountName)); + } + + /** + * List all private endpoint connections in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listByAccountAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Video Indexer account along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName 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, accountName, privateEndpointConnectionName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Video Indexer account along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName 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, accountName, privateEndpointConnectionName, accept, context); + } + + /** + * Get the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Video Indexer account on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, + String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Video Indexer account along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, context).block(); + } + + /** + * Get the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Video Indexer account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get(String resourceGroupName, String accountName, + String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, Context.NONE).getValue(); + } + + /** + * Update the state of specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param body The body 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 private endpoint connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, String privateEndpointConnectionName, PrivateEndpointConnectionInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, body, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the state of specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param body The body 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 private endpoint connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, String privateEndpointConnectionName, PrivateEndpointConnectionInner body, + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, body, + accept, context); + } + + /** + * Update the state of specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param body The body 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 {@link PollerFlux} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, body); + 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 Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param body The body 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 {@link PollerFlux} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> + beginCreateOrUpdateAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, accountName, + privateEndpointConnectionName, body, 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 Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param body The body 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 {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, accountName, privateEndpointConnectionName, body) + .getSyncPoller(); + } + + /** + * Update the state of specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param body The body 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 {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner body, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, accountName, privateEndpointConnectionName, body, context) + .getSyncPoller(); + } + + /** + * Update the state of specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param body The body 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 private endpoint connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, privateEndpointConnectionName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param body The body 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 private endpoint connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, privateEndpointConnectionName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param body The body 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 private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String accountName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner body) { + return createOrUpdateAsync(resourceGroupName, accountName, privateEndpointConnectionName, body).block(); + } + + /** + * Update the state of specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param body The body 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 private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String accountName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, accountName, privateEndpointConnectionName, body, context) + .block(); + } + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName 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.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, + 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName 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.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, privateEndpointConnectionName, accept, context); + } + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String privateEndpointConnectionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, 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 Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String privateEndpointConnectionName) { + return this.beginDeleteAsync(resourceGroupName, accountName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context) { + return this.beginDeleteAsync(resourceGroupName, accountName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, accountName, privateEndpointConnectionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName, + Context context) { + return beginDeleteAsync(resourceGroupName, accountName, privateEndpointConnectionName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, accountName, privateEndpointConnectionName).block(); + } + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName, + Context context) { + deleteAsync(resourceGroupName, accountName, privateEndpointConnectionName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with the specified resource along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountNextSinglePageAsync(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.listByAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with the specified resource along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountNextSinglePageAsync(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.listByAccountNext(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/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateEndpointConnectionsImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..c349a5a54c34 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.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.vi.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.vi.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.vi.models.PrivateEndpointConnection; +import com.azure.resourcemanager.vi.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.vi.ViManager serviceManager; + + public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.vi.ViManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByAccount(String resourceGroupName, String accountName) { + PagedIterable inner + = this.serviceClient().listByAccount(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByAccount(String resourceGroupName, String accountName, + Context context) { + PagedIterable inner + = this.serviceClient().listByAccount(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection get(String resourceGroupName, String accountName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner + = this.serviceClient().get(resourceGroupName, accountName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, accountName, privateEndpointConnectionName); + } + + public void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName, + Context context) { + this.serviceClient().delete(resourceGroupName, accountName, privateEndpointConnectionName, context); + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.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, accountName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.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, accountName, privateEndpointConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.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, accountName, privateEndpointConnectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String privateEndpointConnectionName + = ResourceManagerUtils.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, accountName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.vi.ViManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateLinkResourceImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..4aa247644770 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.vi.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.vi.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.vi.ViManager serviceManager; + + PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.vi.ViManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String 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.vi.ViManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateLinkResourcesClientImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..c735b69c0ffe --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.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.vi.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.vi.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.vi.models.PrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final PrivateLinkResourcesService service; + + /** + * The service client containing this operation class. + */ + private final ViManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(ViManagementClientImpl client) { + this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ViManagementClientPrivateLinkResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ViManagementClientPr") + public interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts/{accountName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAccount(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VideoIndexer/accounts/{accountName}/privateLinkResources/{groupId}") + @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("accountName") String accountName, + @PathParam("groupId") String groupId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List all private link resources in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync(String resourceGroupName, + String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, 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 link resources in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync(String resourceGroupName, + String accountName, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByAccount(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all private link resources in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of private link resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listByAccountSinglePageAsync(resourceGroupName, accountName), + nextLink -> listByAccountNextSinglePageAsync(nextLink)); + } + + /** + * List all private link resources in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of private link resources as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listByAccountSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listByAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * List all private link resources in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount(String resourceGroupName, String accountName) { + return new PagedIterable<>(listByAccountAsync(resourceGroupName, accountName)); + } + + /** + * List all private link resources in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of private link resources as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listByAccountAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the private link resource with the specified group Id associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param groupId The group ID 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 the private link resource with the specified group Id associated with the Video Indexer account along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String groupId) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId 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, accountName, groupId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the private link resource with the specified group Id associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param groupId The group ID 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 the private link resource with the specified group Id associated with the Video Indexer account along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String groupId, 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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId 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, accountName, groupId, accept, context); + } + + /** + * Get the private link resource with the specified group Id associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param groupId The group ID 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 the private link resource with the specified group Id associated with the Video Indexer account on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String groupId) { + return getWithResponseAsync(resourceGroupName, accountName, groupId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the private link resource with the specified group Id associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param groupId The group ID 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 the private link resource with the specified group Id associated with the Video Indexer account along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String groupId, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, groupId, context).block(); + } + + /** + * Get the private link resource with the specified group Id associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param groupId The group ID 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 the private link resource with the specified group Id associated with the Video Indexer account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String accountName, String groupId) { + return getWithResponse(resourceGroupName, accountName, groupId, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountNextSinglePageAsync(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.listByAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 list of private link resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountNextSinglePageAsync(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.listByAccountNext(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/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateLinkResourcesImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..75fd186c0731 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.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.vi.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.vi.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.vi.models.PrivateLinkResource; +import com.azure.resourcemanager.vi.models.PrivateLinkResources; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.vi.ViManager serviceManager; + + public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.vi.ViManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByAccount(String resourceGroupName, String accountName) { + PagedIterable inner + = this.serviceClient().listByAccount(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByAccount(String resourceGroupName, String accountName, + Context context) { + PagedIterable inner + = this.serviceClient().listByAccount(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String accountName, String groupId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, groupId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateLinkResource get(String resourceGroupName, String accountName, String groupId) { + PrivateLinkResourceInner inner = this.serviceClient().get(resourceGroupName, accountName, groupId); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.vi.ViManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/ResourceManagerUtils.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..1abcc6818000 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.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 ResourceManagerUtils { + private ResourceManagerUtils() { + } + + 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.isEmpty() && 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<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(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/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/ViManagementClientBuilder.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/ViManagementClientBuilder.java new file mode 100644 index 000000000000..c81fc4d5f6de --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/ViManagementClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the ViManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { ViManagementClientImpl.class }) +public final class ViManagementClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the ViManagementClientBuilder. + */ + public ViManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ViManagementClientBuilder. + */ + public ViManagementClientBuilder 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 ViManagementClientBuilder. + */ + public ViManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ViManagementClientBuilder. + */ + public ViManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ViManagementClientBuilder. + */ + public ViManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ViManagementClientBuilder. + */ + public ViManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ViManagementClientImpl with the provided parameters. + * + * @return an instance of ViManagementClientImpl. + */ + public ViManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + ViManagementClientImpl client = new ViManagementClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/ViManagementClientImpl.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/ViManagementClientImpl.java new file mode 100644 index 000000000000..c5f1c35de1f3 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/ViManagementClientImpl.java @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.vi.fluent.AccountsClient; +import com.azure.resourcemanager.vi.fluent.GeneratesClient; +import com.azure.resourcemanager.vi.fluent.OperationsClient; +import com.azure.resourcemanager.vi.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.vi.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.vi.fluent.ViManagementClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the ViManagementClientImpl type. + */ +@ServiceClient(builder = ViManagementClientBuilder.class) +public final class ViManagementClientImpl implements ViManagementClient { + /** + * The ID of the target subscription. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @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 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 AccountsClient object to access its operations. + */ + private final AccountsClient accounts; + + /** + * Gets the AccountsClient object to access its operations. + * + * @return the AccountsClient object. + */ + public AccountsClient getAccounts() { + return this.accounts; + } + + /** + * The GeneratesClient object to access its operations. + */ + private final GeneratesClient generates; + + /** + * Gets the GeneratesClient object to access its operations. + * + * @return the GeneratesClient object. + */ + public GeneratesClient getGenerates() { + return this.generates; + } + + /** + * 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 PrivateLinkResourcesClient object to access its operations. + */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** + * Initializes an instance of ViManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + ViManagementClientImpl(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 = "2025-04-01"; + this.operations = new OperationsClientImpl(this); + this.accounts = new AccountsClientImpl(this); + this.generates = new GeneratesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(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(ViManagementClientImpl.class); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/package-info.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/package-info.java new file mode 100644 index 000000000000..0804b0b7d8b1 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/implementation/package-info.java @@ -0,0 +1,9 @@ +// 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 ViManagementClient. + * Microsoft Azure Video Indexer. + */ +package com.azure.resourcemanager.vi.implementation; diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccessToken.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccessToken.java new file mode 100644 index 000000000000..00a0a1f67236 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccessToken.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.vi.models; + +import com.azure.resourcemanager.vi.fluent.models.AccessTokenInner; + +/** + * An immutable client-side representation of AccessToken. + */ +public interface AccessToken { + /** + * Gets the accessToken property: The access token. + * + * @return the accessToken value. + */ + String accessToken(); + + /** + * Gets the inner com.azure.resourcemanager.vi.fluent.models.AccessTokenInner object. + * + * @return the inner object. + */ + AccessTokenInner innerModel(); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Account.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Account.java new file mode 100644 index 000000000000..d850af227966 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Account.java @@ -0,0 +1,469 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.vi.fluent.models.AccountInner; +import com.azure.resourcemanager.vi.fluent.models.PrivateEndpointConnectionInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of Account. + */ +public interface Account { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: The system meta data relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the tenantId property: The account's tenant id. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the accountId property: The account's data-plane ID. This can be set only when connecting an existing + * classic account. + * + * @return the accountId value. + */ + String accountId(); + + /** + * Gets the accountName property: The account's name. + * + * @return the accountName value. + */ + String accountName(); + + /** + * Gets the storageServices property: The storage services details. + * + * @return the storageServices value. + */ + StorageServicesForPutRequest storageServices(); + + /** + * Gets the openAiServices property: The openAi services details. + * + * @return the openAiServices value. + */ + OpenAiServicesForPutRequest openAiServices(); + + /** + * Gets the totalSecondsIndexed property: An integer representing the total seconds that have been indexed on the + * account. + * + * @return the totalSecondsIndexed value. + */ + Integer totalSecondsIndexed(); + + /** + * Gets the totalMinutesIndexed property: An integer representing the total minutes that have been indexed on the + * account. + * + * @return the totalMinutesIndexed value. + */ + Long totalMinutesIndexed(); + + /** + * Gets the publicNetworkAccess property: Whether or not public network access is allowed for the account. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the privateEndpointConnections property: List of private endpoint connections associated with the account. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the provisioningState property: Gets the status of the account at the time the operation was called. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.vi.fluent.models.AccountInner object. + * + * @return the inner object. + */ + AccountInner innerModel(); + + /** + * The entirety of the Account definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Account definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Account definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Account 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 Account definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Account 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.WithAccountId, DefinitionStages.WithStorageServices, DefinitionStages.WithOpenAiServices, + DefinitionStages.WithPublicNetworkAccess, DefinitionStages.WithPrivateEndpointConnections { + /** + * Executes the create request. + * + * @return the created resource. + */ + Account create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Account create(Context context); + } + + /** + * The stage of the Account 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 Account definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). + * + * @param identity Managed service identity (system assigned and/or user assigned identities). + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the Account definition allowing to specify accountId. + */ + interface WithAccountId { + /** + * Specifies the accountId property: The account's data-plane ID. This can be set only when connecting an + * existing classic account. + * + * @param accountId The account's data-plane ID. This can be set only when connecting an existing classic + * account. + * @return the next definition stage. + */ + WithCreate withAccountId(String accountId); + } + + /** + * The stage of the Account definition allowing to specify storageServices. + */ + interface WithStorageServices { + /** + * Specifies the storageServices property: The storage services details. + * + * @param storageServices The storage services details. + * @return the next definition stage. + */ + WithCreate withStorageServices(StorageServicesForPutRequest storageServices); + } + + /** + * The stage of the Account definition allowing to specify openAiServices. + */ + interface WithOpenAiServices { + /** + * Specifies the openAiServices property: The openAi services details. + * + * @param openAiServices The openAi services details. + * @return the next definition stage. + */ + WithCreate withOpenAiServices(OpenAiServicesForPutRequest openAiServices); + } + + /** + * The stage of the Account definition allowing to specify publicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Whether or not public network access is allowed for the + * account.. + * + * @param publicNetworkAccess Whether or not public network access is allowed for the account. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + + /** + * The stage of the Account definition allowing to specify privateEndpointConnections. + */ + interface WithPrivateEndpointConnections { + /** + * Specifies the privateEndpointConnections property: List of private endpoint connections associated with + * the account.. + * + * @param privateEndpointConnections List of private endpoint connections associated with the account. + * @return the next definition stage. + */ + WithCreate withPrivateEndpointConnections(List privateEndpointConnections); + } + } + + /** + * Begins update for the Account resource. + * + * @return the stage of resource update. + */ + Account.Update update(); + + /** + * The template for Account update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithStorageServices, + UpdateStages.WithOpenAiServices, UpdateStages.WithPublicNetworkAccess, + UpdateStages.WithPrivateEndpointConnections { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Account apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Account apply(Context context); + } + + /** + * The Account update stages. + */ + interface UpdateStages { + /** + * The stage of the Account update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the Account update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (system assigned and/or user assigned + * identities). + * + * @param identity Managed service identity (system assigned and/or user assigned identities). + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the Account update allowing to specify storageServices. + */ + interface WithStorageServices { + /** + * Specifies the storageServices property: The storage services details. + * + * @param storageServices The storage services details. + * @return the next definition stage. + */ + Update withStorageServices(StorageServicesForPatchRequest storageServices); + } + + /** + * The stage of the Account update allowing to specify openAiServices. + */ + interface WithOpenAiServices { + /** + * Specifies the openAiServices property: The openAi services details. + * + * @param openAiServices The openAi services details. + * @return the next definition stage. + */ + Update withOpenAiServices(OpenAiServicesForPatchRequest openAiServices); + } + + /** + * The stage of the Account update allowing to specify publicNetworkAccess. + */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Whether or not public network access is allowed for the + * account.. + * + * @param publicNetworkAccess Whether or not public network access is allowed for the account. + * @return the next definition stage. + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + + /** + * The stage of the Account update allowing to specify privateEndpointConnections. + */ + interface WithPrivateEndpointConnections { + /** + * Specifies the privateEndpointConnections property: List of private endpoint connections associated with + * the account.. + * + * @param privateEndpointConnections List of private endpoint connections associated with the account. + * @return the next definition stage. + */ + Update withPrivateEndpointConnections(List privateEndpointConnections); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Account refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Account refresh(Context context); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccountCheckNameAvailabilityParameters.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccountCheckNameAvailabilityParameters.java new file mode 100644 index 000000000000..6e81d6b864a7 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccountCheckNameAvailabilityParameters.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The parameters used to check the availability of the Video Indexer account name. + */ +@Fluent +public final class AccountCheckNameAvailabilityParameters + implements JsonSerializable { + /* + * The VideoIndexer account name. + */ + private String name; + + /* + * The type of resource, Microsoft.VideoIndexer/accounts + */ + private Type type; + + /** + * Creates an instance of AccountCheckNameAvailabilityParameters class. + */ + public AccountCheckNameAvailabilityParameters() { + } + + /** + * Get the name property: The VideoIndexer account name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The VideoIndexer account name. + * + * @param name the name value to set. + * @return the AccountCheckNameAvailabilityParameters object itself. + */ + public AccountCheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of resource, Microsoft.VideoIndexer/accounts. + * + * @return the type value. + */ + public Type type() { + return this.type; + } + + /** + * Set the type property: The type of resource, Microsoft.VideoIndexer/accounts. + * + * @param type the type value to set. + * @return the AccountCheckNameAvailabilityParameters object itself. + */ + public AccountCheckNameAvailabilityParameters withType(Type 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.atError() + .log(new IllegalArgumentException( + "Missing required property name in model AccountCheckNameAvailabilityParameters")); + } + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property type in model AccountCheckNameAvailabilityParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccountCheckNameAvailabilityParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountCheckNameAvailabilityParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountCheckNameAvailabilityParameters if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AccountCheckNameAvailabilityParameters. + */ + public static AccountCheckNameAvailabilityParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountCheckNameAvailabilityParameters deserializedAccountCheckNameAvailabilityParameters + = new AccountCheckNameAvailabilityParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAccountCheckNameAvailabilityParameters.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAccountCheckNameAvailabilityParameters.type = Type.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountCheckNameAvailabilityParameters; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccountList.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccountList.java new file mode 100644 index 000000000000..f91f2d1e47c0 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccountList.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.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.vi.fluent.models.AccountInner; +import java.io.IOException; +import java.util.List; + +/** + * The list operation response, that contains the data pools and their properties. + */ +@Fluent +public final class AccountList implements JsonSerializable { + /* + * List of accounts and their properties. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of AccountList class. + */ + public AccountList() { + } + + /** + * Get the value property: List of accounts and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the AccountList object itself. + */ + public AccountList 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AccountList. + */ + public static AccountList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountList deserializedAccountList = new AccountList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AccountInner.fromJson(reader1)); + deserializedAccountList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAccountList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountList; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccountPatch.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccountPatch.java new file mode 100644 index 000000000000..3b2a5500a8eb --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/AccountPatch.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.vi.fluent.models.AccountPropertiesForPatchRequest; +import com.azure.resourcemanager.vi.fluent.models.PrivateEndpointConnectionInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Azure Video Indexer account. + */ +@Fluent +public final class AccountPatch extends Tags { + /* + * List of account properties + */ + private AccountPropertiesForPatchRequest innerProperties; + + /* + * Managed service identity (system assigned and/or user assigned identities) + */ + private ManagedServiceIdentity identity; + + /** + * Creates an instance of AccountPatch class. + */ + public AccountPatch() { + } + + /** + * Get the innerProperties property: List of account properties. + * + * @return the innerProperties value. + */ + private AccountPropertiesForPatchRequest innerProperties() { + return this.innerProperties; + } + + /** + * Get the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (system assigned and/or user assigned identities). + * + * @param identity the identity value to set. + * @return the AccountPatch object itself. + */ + public AccountPatch withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AccountPatch withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the tenantId property: The account's tenant id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.innerProperties() == null ? null : this.innerProperties().tenantId(); + } + + /** + * Get the accountId property: The account's data-plane ID. + * + * @return the accountId value. + */ + public String accountId() { + return this.innerProperties() == null ? null : this.innerProperties().accountId(); + } + + /** + * Get the storageServices property: The storage services details. + * + * @return the storageServices value. + */ + public StorageServicesForPatchRequest storageServices() { + return this.innerProperties() == null ? null : this.innerProperties().storageServices(); + } + + /** + * Set the storageServices property: The storage services details. + * + * @param storageServices the storageServices value to set. + * @return the AccountPatch object itself. + */ + public AccountPatch withStorageServices(StorageServicesForPatchRequest storageServices) { + if (this.innerProperties() == null) { + this.innerProperties = new AccountPropertiesForPatchRequest(); + } + this.innerProperties().withStorageServices(storageServices); + return this; + } + + /** + * Get the openAiServices property: The openAi services details. + * + * @return the openAiServices value. + */ + public OpenAiServicesForPatchRequest openAiServices() { + return this.innerProperties() == null ? null : this.innerProperties().openAiServices(); + } + + /** + * Set the openAiServices property: The openAi services details. + * + * @param openAiServices the openAiServices value to set. + * @return the AccountPatch object itself. + */ + public AccountPatch withOpenAiServices(OpenAiServicesForPatchRequest openAiServices) { + if (this.innerProperties() == null) { + this.innerProperties = new AccountPropertiesForPatchRequest(); + } + this.innerProperties().withOpenAiServices(openAiServices); + return this; + } + + /** + * Get the publicNetworkAccess property: Whether or not public network access is allowed for the account. + * + * @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 account. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the AccountPatch object itself. + */ + public AccountPatch withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new AccountPropertiesForPatchRequest(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections associated with the account. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Set the privateEndpointConnections property: List of private endpoint connections associated with the account. + * + * @param privateEndpointConnections the privateEndpointConnections value to set. + * @return the AccountPatch object itself. + */ + public AccountPatch + withPrivateEndpointConnections(List privateEndpointConnections) { + if (this.innerProperties() == null) { + this.innerProperties = new AccountPropertiesForPatchRequest(); + } + this.innerProperties().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + + /** + * Get the provisioningState property: Gets the status of the account 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. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountPatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AccountPatch. + */ + public static AccountPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountPatch deserializedAccountPatch = new AccountPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAccountPatch.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedAccountPatch.innerProperties = AccountPropertiesForPatchRequest.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedAccountPatch.identity = ManagedServiceIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountPatch; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Accounts.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Accounts.java new file mode 100644 index 000000000000..bb0be62d286b --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Accounts.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.vi.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 Accounts. + */ +public interface Accounts { + /** + * Checks that the Video Indexer account name is valid and is not already in use. + * + * @param checkNameAvailabilityParameters The name of the Video Indexer account. Name must be unique globally. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse( + AccountCheckNameAvailabilityParameters checkNameAvailabilityParameters, Context context); + + /** + * Checks that the Video Indexer account name is valid and is not already in use. + * + * @param checkNameAvailabilityParameters The name of the Video Indexer account. Name must be unique globally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + CheckNameAvailabilityResult + checkNameAvailability(AccountCheckNameAvailabilityParameters checkNameAvailabilityParameters); + + /** + * List all Azure Video Indexer accounts available under the 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 list operation response, that contains the data pools and their properties as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List all Azure Video Indexer accounts available under the 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 list operation response, that contains the data pools and their properties as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List all Azure Video Indexer accounts available under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation response, that contains the data pools and their properties as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all Azure Video Indexer accounts available under the resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list operation response, that contains the data pools and their properties as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the properties of an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an Azure Video Indexer account along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Gets the properties of an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an Azure Video Indexer account. + */ + Account getByResourceGroup(String resourceGroupName, String accountName); + + /** + * Delete an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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}. + */ + Response deleteByResourceGroupWithResponse(String resourceGroupName, String accountName, Context context); + + /** + * Delete an Azure Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 accountName); + + /** + * Gets the properties of an Azure Video Indexer account. + * + * @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 an Azure Video Indexer account along with {@link Response}. + */ + Account getById(String id); + + /** + * Gets the properties of an Azure Video Indexer account. + * + * @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 an Azure Video Indexer account along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an Azure Video Indexer account. + * + * @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); + + /** + * Delete an Azure Video Indexer account. + * + * @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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Account resource. + * + * @param name resource name. + * @return the first stage of the new Account definition. + */ + Account.DefinitionStages.Blank define(String name); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/CheckNameAvailabilityResult.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/CheckNameAvailabilityResult.java new file mode 100644 index 000000000000..cbc03d686b21 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/CheckNameAvailabilityResult.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.vi.models; + +import com.azure.resourcemanager.vi.fluent.models.CheckNameAvailabilityResultInner; + +/** + * An immutable client-side representation of CheckNameAvailabilityResult. + */ +public interface CheckNameAvailabilityResult { + /** + * Gets the nameAvailable property: Gets a boolean value that indicates whether the name is available for you to + * use. If true, the name is available. If false, the name has already been taken. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: Gets the reason that a Video Indexer account name could not be used. The Reason element + * is only returned if NameAvailable is false. + * + * @return the reason value. + */ + Reason reason(); + + /** + * Gets the message property: Gets an error message explaining the Reason value in more detail. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.vi.fluent.models.CheckNameAvailabilityResultInner object. + * + * @return the inner object. + */ + CheckNameAvailabilityResultInner innerModel(); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateAccessTokenParameters.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateAccessTokenParameters.java new file mode 100644 index 000000000000..994ea98c210d --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateAccessTokenParameters.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.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Access token generation request's parameters. + */ +@Fluent +public final class GenerateAccessTokenParameters implements JsonSerializable { + /* + * The requested permission + */ + private PermissionType permissionType; + + /* + * The requested media type + */ + private Scope scope; + + /* + * The video ID + */ + private String videoId; + + /* + * The project ID + */ + private String projectId; + + /** + * Creates an instance of GenerateAccessTokenParameters class. + */ + public GenerateAccessTokenParameters() { + } + + /** + * Get the permissionType property: The requested permission. + * + * @return the permissionType value. + */ + public PermissionType permissionType() { + return this.permissionType; + } + + /** + * Set the permissionType property: The requested permission. + * + * @param permissionType the permissionType value to set. + * @return the GenerateAccessTokenParameters object itself. + */ + public GenerateAccessTokenParameters withPermissionType(PermissionType permissionType) { + this.permissionType = permissionType; + return this; + } + + /** + * Get the scope property: The requested media type. + * + * @return the scope value. + */ + public Scope scope() { + return this.scope; + } + + /** + * Set the scope property: The requested media type. + * + * @param scope the scope value to set. + * @return the GenerateAccessTokenParameters object itself. + */ + public GenerateAccessTokenParameters withScope(Scope scope) { + this.scope = scope; + return this; + } + + /** + * Get the videoId property: The video ID. + * + * @return the videoId value. + */ + public String videoId() { + return this.videoId; + } + + /** + * Set the videoId property: The video ID. + * + * @param videoId the videoId value to set. + * @return the GenerateAccessTokenParameters object itself. + */ + public GenerateAccessTokenParameters withVideoId(String videoId) { + this.videoId = videoId; + return this; + } + + /** + * Get the projectId property: The project ID. + * + * @return the projectId value. + */ + public String projectId() { + return this.projectId; + } + + /** + * Set the projectId property: The project ID. + * + * @param projectId the projectId value to set. + * @return the GenerateAccessTokenParameters object itself. + */ + public GenerateAccessTokenParameters withProjectId(String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (permissionType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property permissionType in model GenerateAccessTokenParameters")); + } + if (scope() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property scope in model GenerateAccessTokenParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GenerateAccessTokenParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("permissionType", + this.permissionType == null ? null : this.permissionType.toString()); + jsonWriter.writeStringField("scope", this.scope == null ? null : this.scope.toString()); + jsonWriter.writeStringField("videoId", this.videoId); + jsonWriter.writeStringField("projectId", this.projectId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenerateAccessTokenParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenerateAccessTokenParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GenerateAccessTokenParameters. + */ + public static GenerateAccessTokenParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GenerateAccessTokenParameters deserializedGenerateAccessTokenParameters + = new GenerateAccessTokenParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("permissionType".equals(fieldName)) { + deserializedGenerateAccessTokenParameters.permissionType + = PermissionType.fromString(reader.getString()); + } else if ("scope".equals(fieldName)) { + deserializedGenerateAccessTokenParameters.scope = Scope.fromString(reader.getString()); + } else if ("videoId".equals(fieldName)) { + deserializedGenerateAccessTokenParameters.videoId = reader.getString(); + } else if ("projectId".equals(fieldName)) { + deserializedGenerateAccessTokenParameters.projectId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGenerateAccessTokenParameters; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateExtensionAccessTokenParameters.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateExtensionAccessTokenParameters.java new file mode 100644 index 000000000000..2eb2ada21111 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateExtensionAccessTokenParameters.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Access token generation request's parameters. + */ +@Fluent +public final class GenerateExtensionAccessTokenParameters + implements JsonSerializable { + /* + * The requested permission + */ + private PermissionType permissionType; + + /* + * The requested media type + */ + private Scope scope; + + /* + * The extension's resource ID + */ + private String extensionId; + + /* + * The video ID + */ + private String videoId; + + /* + * Lifetime of the access token (in seconds). Default value: 3600 (1 hour), Max value: 43200 (12 hours). Setting + * this value is enabled for tokens in 'Video' scope. + */ + private Integer tokenLifetimeInSeconds; + + /** + * Creates an instance of GenerateExtensionAccessTokenParameters class. + */ + public GenerateExtensionAccessTokenParameters() { + } + + /** + * Get the permissionType property: The requested permission. + * + * @return the permissionType value. + */ + public PermissionType permissionType() { + return this.permissionType; + } + + /** + * Set the permissionType property: The requested permission. + * + * @param permissionType the permissionType value to set. + * @return the GenerateExtensionAccessTokenParameters object itself. + */ + public GenerateExtensionAccessTokenParameters withPermissionType(PermissionType permissionType) { + this.permissionType = permissionType; + return this; + } + + /** + * Get the scope property: The requested media type. + * + * @return the scope value. + */ + public Scope scope() { + return this.scope; + } + + /** + * Set the scope property: The requested media type. + * + * @param scope the scope value to set. + * @return the GenerateExtensionAccessTokenParameters object itself. + */ + public GenerateExtensionAccessTokenParameters withScope(Scope scope) { + this.scope = scope; + return this; + } + + /** + * Get the extensionId property: The extension's resource ID. + * + * @return the extensionId value. + */ + public String extensionId() { + return this.extensionId; + } + + /** + * Set the extensionId property: The extension's resource ID. + * + * @param extensionId the extensionId value to set. + * @return the GenerateExtensionAccessTokenParameters object itself. + */ + public GenerateExtensionAccessTokenParameters withExtensionId(String extensionId) { + this.extensionId = extensionId; + return this; + } + + /** + * Get the videoId property: The video ID. + * + * @return the videoId value. + */ + public String videoId() { + return this.videoId; + } + + /** + * Set the videoId property: The video ID. + * + * @param videoId the videoId value to set. + * @return the GenerateExtensionAccessTokenParameters object itself. + */ + public GenerateExtensionAccessTokenParameters withVideoId(String videoId) { + this.videoId = videoId; + return this; + } + + /** + * Get the tokenLifetimeInSeconds property: Lifetime of the access token (in seconds). Default value: 3600 (1 hour), + * Max value: 43200 (12 hours). Setting this value is enabled for tokens in 'Video' scope. + * + * @return the tokenLifetimeInSeconds value. + */ + public Integer tokenLifetimeInSeconds() { + return this.tokenLifetimeInSeconds; + } + + /** + * Set the tokenLifetimeInSeconds property: Lifetime of the access token (in seconds). Default value: 3600 (1 hour), + * Max value: 43200 (12 hours). Setting this value is enabled for tokens in 'Video' scope. + * + * @param tokenLifetimeInSeconds the tokenLifetimeInSeconds value to set. + * @return the GenerateExtensionAccessTokenParameters object itself. + */ + public GenerateExtensionAccessTokenParameters withTokenLifetimeInSeconds(Integer tokenLifetimeInSeconds) { + this.tokenLifetimeInSeconds = tokenLifetimeInSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (permissionType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property permissionType in model GenerateExtensionAccessTokenParameters")); + } + if (scope() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property scope in model GenerateExtensionAccessTokenParameters")); + } + if (extensionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property extensionId in model GenerateExtensionAccessTokenParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GenerateExtensionAccessTokenParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("permissionType", + this.permissionType == null ? null : this.permissionType.toString()); + jsonWriter.writeStringField("scope", this.scope == null ? null : this.scope.toString()); + jsonWriter.writeStringField("extensionId", this.extensionId); + jsonWriter.writeStringField("videoId", this.videoId); + jsonWriter.writeNumberField("tokenLifetimeInSeconds", this.tokenLifetimeInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenerateExtensionAccessTokenParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenerateExtensionAccessTokenParameters if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GenerateExtensionAccessTokenParameters. + */ + public static GenerateExtensionAccessTokenParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GenerateExtensionAccessTokenParameters deserializedGenerateExtensionAccessTokenParameters + = new GenerateExtensionAccessTokenParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("permissionType".equals(fieldName)) { + deserializedGenerateExtensionAccessTokenParameters.permissionType + = PermissionType.fromString(reader.getString()); + } else if ("scope".equals(fieldName)) { + deserializedGenerateExtensionAccessTokenParameters.scope = Scope.fromString(reader.getString()); + } else if ("extensionId".equals(fieldName)) { + deserializedGenerateExtensionAccessTokenParameters.extensionId = reader.getString(); + } else if ("videoId".equals(fieldName)) { + deserializedGenerateExtensionAccessTokenParameters.videoId = reader.getString(); + } else if ("tokenLifetimeInSeconds".equals(fieldName)) { + deserializedGenerateExtensionAccessTokenParameters.tokenLifetimeInSeconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedGenerateExtensionAccessTokenParameters; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateExtensionRestrictedViewerAccessTokenParameters.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateExtensionRestrictedViewerAccessTokenParameters.java new file mode 100644 index 000000000000..8d9588df3fde --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateExtensionRestrictedViewerAccessTokenParameters.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Restricted viewer access token generation request's parameters. + */ +@Fluent +public final class GenerateExtensionRestrictedViewerAccessTokenParameters + implements JsonSerializable { + /* + * The requested media type + */ + private Scope scope; + + /* + * The extension's resource ID + */ + private String extensionId; + + /* + * The video ID + */ + private String videoId; + + /* + * Lifetime of the access token (in seconds). Default value: 3600 (1 hour), Max value: 43200 (12 hours). Setting + * this value is enabled for tokens in 'Video' scope. + */ + private Integer tokenLifetimeInSeconds; + + /** + * Creates an instance of GenerateExtensionRestrictedViewerAccessTokenParameters class. + */ + public GenerateExtensionRestrictedViewerAccessTokenParameters() { + } + + /** + * Get the scope property: The requested media type. + * + * @return the scope value. + */ + public Scope scope() { + return this.scope; + } + + /** + * Set the scope property: The requested media type. + * + * @param scope the scope value to set. + * @return the GenerateExtensionRestrictedViewerAccessTokenParameters object itself. + */ + public GenerateExtensionRestrictedViewerAccessTokenParameters withScope(Scope scope) { + this.scope = scope; + return this; + } + + /** + * Get the extensionId property: The extension's resource ID. + * + * @return the extensionId value. + */ + public String extensionId() { + return this.extensionId; + } + + /** + * Set the extensionId property: The extension's resource ID. + * + * @param extensionId the extensionId value to set. + * @return the GenerateExtensionRestrictedViewerAccessTokenParameters object itself. + */ + public GenerateExtensionRestrictedViewerAccessTokenParameters withExtensionId(String extensionId) { + this.extensionId = extensionId; + return this; + } + + /** + * Get the videoId property: The video ID. + * + * @return the videoId value. + */ + public String videoId() { + return this.videoId; + } + + /** + * Set the videoId property: The video ID. + * + * @param videoId the videoId value to set. + * @return the GenerateExtensionRestrictedViewerAccessTokenParameters object itself. + */ + public GenerateExtensionRestrictedViewerAccessTokenParameters withVideoId(String videoId) { + this.videoId = videoId; + return this; + } + + /** + * Get the tokenLifetimeInSeconds property: Lifetime of the access token (in seconds). Default value: 3600 (1 hour), + * Max value: 43200 (12 hours). Setting this value is enabled for tokens in 'Video' scope. + * + * @return the tokenLifetimeInSeconds value. + */ + public Integer tokenLifetimeInSeconds() { + return this.tokenLifetimeInSeconds; + } + + /** + * Set the tokenLifetimeInSeconds property: Lifetime of the access token (in seconds). Default value: 3600 (1 hour), + * Max value: 43200 (12 hours). Setting this value is enabled for tokens in 'Video' scope. + * + * @param tokenLifetimeInSeconds the tokenLifetimeInSeconds value to set. + * @return the GenerateExtensionRestrictedViewerAccessTokenParameters object itself. + */ + public GenerateExtensionRestrictedViewerAccessTokenParameters + withTokenLifetimeInSeconds(Integer tokenLifetimeInSeconds) { + this.tokenLifetimeInSeconds = tokenLifetimeInSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scope() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property scope in model GenerateExtensionRestrictedViewerAccessTokenParameters")); + } + if (extensionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property extensionId in model GenerateExtensionRestrictedViewerAccessTokenParameters")); + } + } + + private static final ClientLogger LOGGER + = new ClientLogger(GenerateExtensionRestrictedViewerAccessTokenParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scope", this.scope == null ? null : this.scope.toString()); + jsonWriter.writeStringField("extensionId", this.extensionId); + jsonWriter.writeStringField("videoId", this.videoId); + jsonWriter.writeNumberField("tokenLifetimeInSeconds", this.tokenLifetimeInSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenerateExtensionRestrictedViewerAccessTokenParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenerateExtensionRestrictedViewerAccessTokenParameters if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GenerateExtensionRestrictedViewerAccessTokenParameters. + */ + public static GenerateExtensionRestrictedViewerAccessTokenParameters fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + GenerateExtensionRestrictedViewerAccessTokenParameters deserializedGenerateExtensionRestrictedViewerAccessTokenParameters + = new GenerateExtensionRestrictedViewerAccessTokenParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scope".equals(fieldName)) { + deserializedGenerateExtensionRestrictedViewerAccessTokenParameters.scope + = Scope.fromString(reader.getString()); + } else if ("extensionId".equals(fieldName)) { + deserializedGenerateExtensionRestrictedViewerAccessTokenParameters.extensionId = reader.getString(); + } else if ("videoId".equals(fieldName)) { + deserializedGenerateExtensionRestrictedViewerAccessTokenParameters.videoId = reader.getString(); + } else if ("tokenLifetimeInSeconds".equals(fieldName)) { + deserializedGenerateExtensionRestrictedViewerAccessTokenParameters.tokenLifetimeInSeconds + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedGenerateExtensionRestrictedViewerAccessTokenParameters; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateRestrictedViewerAccessTokenParameters.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateRestrictedViewerAccessTokenParameters.java new file mode 100644 index 000000000000..b84b64ace2b3 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/GenerateRestrictedViewerAccessTokenParameters.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Restricted viewer access token generation request's parameters. + */ +@Fluent +public final class GenerateRestrictedViewerAccessTokenParameters + implements JsonSerializable { + /* + * The requested media type + */ + private Scope scope; + + /* + * The video ID + */ + private String videoId; + + /* + * The project ID + */ + private String projectId; + + /** + * Creates an instance of GenerateRestrictedViewerAccessTokenParameters class. + */ + public GenerateRestrictedViewerAccessTokenParameters() { + } + + /** + * Get the scope property: The requested media type. + * + * @return the scope value. + */ + public Scope scope() { + return this.scope; + } + + /** + * Set the scope property: The requested media type. + * + * @param scope the scope value to set. + * @return the GenerateRestrictedViewerAccessTokenParameters object itself. + */ + public GenerateRestrictedViewerAccessTokenParameters withScope(Scope scope) { + this.scope = scope; + return this; + } + + /** + * Get the videoId property: The video ID. + * + * @return the videoId value. + */ + public String videoId() { + return this.videoId; + } + + /** + * Set the videoId property: The video ID. + * + * @param videoId the videoId value to set. + * @return the GenerateRestrictedViewerAccessTokenParameters object itself. + */ + public GenerateRestrictedViewerAccessTokenParameters withVideoId(String videoId) { + this.videoId = videoId; + return this; + } + + /** + * Get the projectId property: The project ID. + * + * @return the projectId value. + */ + public String projectId() { + return this.projectId; + } + + /** + * Set the projectId property: The project ID. + * + * @param projectId the projectId value to set. + * @return the GenerateRestrictedViewerAccessTokenParameters object itself. + */ + public GenerateRestrictedViewerAccessTokenParameters withProjectId(String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scope() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property scope in model GenerateRestrictedViewerAccessTokenParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GenerateRestrictedViewerAccessTokenParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scope", this.scope == null ? null : this.scope.toString()); + jsonWriter.writeStringField("videoId", this.videoId); + jsonWriter.writeStringField("projectId", this.projectId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenerateRestrictedViewerAccessTokenParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenerateRestrictedViewerAccessTokenParameters if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GenerateRestrictedViewerAccessTokenParameters. + */ + public static GenerateRestrictedViewerAccessTokenParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GenerateRestrictedViewerAccessTokenParameters deserializedGenerateRestrictedViewerAccessTokenParameters + = new GenerateRestrictedViewerAccessTokenParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scope".equals(fieldName)) { + deserializedGenerateRestrictedViewerAccessTokenParameters.scope + = Scope.fromString(reader.getString()); + } else if ("videoId".equals(fieldName)) { + deserializedGenerateRestrictedViewerAccessTokenParameters.videoId = reader.getString(); + } else if ("projectId".equals(fieldName)) { + deserializedGenerateRestrictedViewerAccessTokenParameters.projectId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGenerateRestrictedViewerAccessTokenParameters; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Generates.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Generates.java new file mode 100644 index 000000000000..99f2c180889f --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Generates.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of Generates. + */ +public interface Generates { + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating access 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 azure Video Indexer access token along with {@link Response}. + */ + Response accessTokenWithResponse(String resourceGroupName, String accountName, + GenerateAccessTokenParameters parameters, Context context); + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token. + */ + AccessToken accessToken(String resourceGroupName, String accountName); + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating restricted viewer access 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 azure Video Indexer access token along with {@link Response}. + */ + Response restrictedViewerAccessTokenWithResponse(String resourceGroupName, String accountName, + GenerateRestrictedViewerAccessTokenParameters parameters, Context context); + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token. + */ + AccessToken restrictedViewerAccessToken(String resourceGroupName, String accountName); + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating access 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 azure Video Indexer access token along with {@link Response}. + */ + Response extensionAccessTokenWithResponse(String resourceGroupName, String accountName, + GenerateExtensionAccessTokenParameters parameters, Context context); + + /** + * Generate an Azure Video Indexer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token. + */ + AccessToken extensionAccessToken(String resourceGroupName, String accountName); + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param parameters The parameters for generating restricted viewer access 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 azure Video Indexer access token along with {@link Response}. + */ + Response extensionRestrictedViewerAccessTokenWithResponse(String resourceGroupName, String accountName, + GenerateExtensionRestrictedViewerAccessTokenParameters parameters, Context context); + + /** + * Generate an Azure Video Indexer restricted viewer access token. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Video Indexer access token. + */ + AccessToken extensionRestrictedViewerAccessToken(String resourceGroupName, String accountName); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/ManagedServiceIdentity.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..3e583fd09ce9 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/ManagedServiceIdentity.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; +import java.util.UUID; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will + * be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/ManagedServiceIdentityType.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..b929fabc322f --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * Static value None for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OpenAiServicesForPatchRequest.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OpenAiServicesForPatchRequest.java new file mode 100644 index 000000000000..5dad42642989 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OpenAiServicesForPatchRequest.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The openAi services details. + */ +@Fluent +public final class OpenAiServicesForPatchRequest implements JsonSerializable { + /* + * The openAi services resource id + */ + private String resourceId; + + /* + * The user assigned identity to be used to grant permissions + */ + private String userAssignedIdentity; + + /** + * Creates an instance of OpenAiServicesForPatchRequest class. + */ + public OpenAiServicesForPatchRequest() { + } + + /** + * Get the resourceId property: The openAi services resource id. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The openAi services resource id. + * + * @param resourceId the resourceId value to set. + * @return the OpenAiServicesForPatchRequest object itself. + */ + public OpenAiServicesForPatchRequest withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the userAssignedIdentity property: The user assigned identity to be used to grant permissions. + * + * @return the userAssignedIdentity value. + */ + public String userAssignedIdentity() { + return this.userAssignedIdentity; + } + + /** + * Set the userAssignedIdentity property: The user assigned identity to be used to grant permissions. + * + * @param userAssignedIdentity the userAssignedIdentity value to set. + * @return the OpenAiServicesForPatchRequest object itself. + */ + public OpenAiServicesForPatchRequest withUserAssignedIdentity(String userAssignedIdentity) { + this.userAssignedIdentity = userAssignedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("userAssignedIdentity", this.userAssignedIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenAiServicesForPatchRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenAiServicesForPatchRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OpenAiServicesForPatchRequest. + */ + public static OpenAiServicesForPatchRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenAiServicesForPatchRequest deserializedOpenAiServicesForPatchRequest + = new OpenAiServicesForPatchRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedOpenAiServicesForPatchRequest.resourceId = reader.getString(); + } else if ("userAssignedIdentity".equals(fieldName)) { + deserializedOpenAiServicesForPatchRequest.userAssignedIdentity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOpenAiServicesForPatchRequest; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OpenAiServicesForPutRequest.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OpenAiServicesForPutRequest.java new file mode 100644 index 000000000000..662e3009f86f --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OpenAiServicesForPutRequest.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The openAi services details. + */ +@Fluent +public final class OpenAiServicesForPutRequest implements JsonSerializable { + /* + * The openAi services resource id + */ + private String resourceId; + + /* + * The user assigned identity to be used to grant permissions + */ + private String userAssignedIdentity; + + /** + * Creates an instance of OpenAiServicesForPutRequest class. + */ + public OpenAiServicesForPutRequest() { + } + + /** + * Get the resourceId property: The openAi services resource id. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The openAi services resource id. + * + * @param resourceId the resourceId value to set. + * @return the OpenAiServicesForPutRequest object itself. + */ + public OpenAiServicesForPutRequest withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the userAssignedIdentity property: The user assigned identity to be used to grant permissions. + * + * @return the userAssignedIdentity value. + */ + public String userAssignedIdentity() { + return this.userAssignedIdentity; + } + + /** + * Set the userAssignedIdentity property: The user assigned identity to be used to grant permissions. + * + * @param userAssignedIdentity the userAssignedIdentity value to set. + * @return the OpenAiServicesForPutRequest object itself. + */ + public OpenAiServicesForPutRequest withUserAssignedIdentity(String userAssignedIdentity) { + this.userAssignedIdentity = userAssignedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("userAssignedIdentity", this.userAssignedIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenAiServicesForPutRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenAiServicesForPutRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OpenAiServicesForPutRequest. + */ + public static OpenAiServicesForPutRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OpenAiServicesForPutRequest deserializedOpenAiServicesForPutRequest = new OpenAiServicesForPutRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedOpenAiServicesForPutRequest.resourceId = reader.getString(); + } else if ("userAssignedIdentity".equals(fieldName)) { + deserializedOpenAiServicesForPutRequest.userAssignedIdentity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOpenAiServicesForPutRequest; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Operation.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Operation.java new file mode 100644 index 000000000000..5ffab19282ae --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Operation.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.vi.models; + +import com.azure.resourcemanager.vi.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: Name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the actionType property: Indicates the action type. + * + * @return the actionType value. + */ + String actionType(); + + /** + * Gets the display property: Display of the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the inner com.azure.resourcemanager.vi.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OperationDisplay.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OperationDisplay.java new file mode 100644 index 000000000000..13efabea09c3 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OperationDisplay.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Operation display payload. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * Resource provider of the operation + */ + private String provider; + + /* + * Resource of the operation + */ + private String resource; + + /* + * Localized friendly name for the operation + */ + private String operation; + + /* + * Localized friendly description for the operation + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + public OperationDisplay() { + } + + /** + * Get the provider property: Resource provider of the operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: Resource of the operation. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: Localized friendly name for the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: Localized friendly description for the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OperationListResult.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OperationListResult.java new file mode 100644 index 000000000000..da5005eb328e --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/OperationListResult.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.vi.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.vi.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * Available operations of the service. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * List of operations supported by the Resource Provider. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the Resource Provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Operations.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Operations.java new file mode 100644 index 000000000000..a662c482511a --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/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.vi.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 Video Indexer provider 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 available operations of the service as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the available Azure Video Indexer provider 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 available operations of the service as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PermissionType.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PermissionType.java new file mode 100644 index 000000000000..67fb9bcac309 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PermissionType.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.vi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The requested permission. + */ +public final class PermissionType extends ExpandableStringEnum { + /** + * Static value Contributor for PermissionType. + */ + public static final PermissionType CONTRIBUTOR = fromString("Contributor"); + + /** + * Static value Reader for PermissionType. + */ + public static final PermissionType READER = fromString("Reader"); + + /** + * Creates a new instance of PermissionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PermissionType() { + } + + /** + * Creates or finds a PermissionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PermissionType. + */ + public static PermissionType fromString(String name) { + return fromString(name, PermissionType.class); + } + + /** + * Gets known PermissionType values. + * + * @return known PermissionType values. + */ + public static Collection values() { + return values(PermissionType.class); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpoint.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpoint.java new file mode 100644 index 000000000000..bde329ef0cd5 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpoint.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.vi.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The private endpoint resource. + */ +@Immutable +public final class PrivateEndpoint implements JsonSerializable { + /* + * The ARM identifier for private endpoint. + */ + private String id; + + /** + * Creates an instance of PrivateEndpoint class. + */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The ARM identifier for private endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnection.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnection.java new file mode 100644 index 000000000000..f39d358429a9 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnection.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.vi.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.vi.fluent.models.PrivateEndpointConnectionInner; +import java.util.List; + +/** + * 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: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + List groupIds(); + + /** + * Gets the privateEndpoint property: The private endpoint resource. + * + * @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 the private endpoint connection resource. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.vi.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, accountName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @return the next definition stage. + */ + WithCreate withExistingAccount(String resourceGroupName, String accountName); + } + + /** + * 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, DefinitionStages.WithProvisioningState { + /** + * 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 private endpoint resource.. + * + * @param privateEndpoint The private endpoint resource. + * @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); + } + + /** + * The stage of the PrivateEndpointConnection definition allowing to specify provisioningState. + */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: The provisioning state of the private endpoint connection + * resource.. + * + * @param provisioningState The provisioning state of the private endpoint connection resource. + * @return the next definition stage. + */ + WithCreate withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState); + } + } + + /** + * 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, + UpdateStages.WithProvisioningState { + /** + * 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 private endpoint resource.. + * + * @param privateEndpoint The private endpoint resource. + * @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); + } + + /** + * The stage of the PrivateEndpointConnection update allowing to specify provisioningState. + */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: The provisioning state of the private endpoint connection + * resource.. + * + * @param provisioningState The provisioning state of the private endpoint connection resource. + * @return the next definition stage. + */ + Update withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState); + } + } + + /** + * 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/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnectionListResult.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 000000000000..32f70c9be530 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.vi.fluent.models.PrivateEndpointConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * List of private endpoint connections associated with the specified resource. + */ +@Fluent +public final class PrivateEndpointConnectionListResult + implements JsonSerializable { + /* + * Array of private endpoint connections. + */ + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + private String nextLink; + + /** + * Creates an instance of PrivateEndpointConnectionListResult class. + */ + public PrivateEndpointConnectionListResult() { + } + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array 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: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResult. + */ + public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResult deserializedPrivateEndpointConnectionListResult + = new PrivateEndpointConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateEndpointConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResult; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnectionProvisioningState.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 000000000000..b96b70644003 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state. + */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** + * Static value Succeeded for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Creating for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Deleting for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Failed for PrivateEndpointConnectionProvisioningState. + */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of PrivateEndpointConnectionProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointConnectionProvisioningState() { + } + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @return known PrivateEndpointConnectionProvisioningState values. + */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnections.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnections.java new file mode 100644 index 000000000000..fe03f8d4e8e1 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointConnections.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.vi.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 Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * List all private endpoint connections in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with the specified resource as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByAccount(String resourceGroupName, String accountName, + Context context); + + /** + * Get the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Video Indexer account along with + * {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context); + + /** + * Get the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Video Indexer account. + */ + PrivateEndpointConnection get(String resourceGroupName, String accountName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context); + + /** + * Get the specified private endpoint connection associated with the Video Indexer account. + * + * @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 Video Indexer account along with + * {@link Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * Get the specified private endpoint connection associated with the Video Indexer account. + * + * @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 Video Indexer account along with + * {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified private endpoint connection associated with the Video Indexer account. + * + * @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 Video Indexer account. + * + * @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/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointServiceConnectionStatus.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 000000000000..a1f455a36e25 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The private endpoint connection status. + */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** + * Static value Pending for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** + * Static value Approved for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** + * Static value Rejected for PrivateEndpointServiceConnectionStatus. + */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates a new instance of PrivateEndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointServiceConnectionStatus() { + } + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @return known PrivateEndpointServiceConnectionStatus values. + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkResource.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkResource.java new file mode 100644 index 000000000000..eac3840df8ff --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkResource.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.vi.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** + * An immutable client-side representation of PrivateLinkResource. + */ +public interface PrivateLinkResource { + /** + * 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: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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.vi.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkResourceListResult.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkResourceListResult.java new file mode 100644 index 000000000000..75a52a8d9d01 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkResourceListResult.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.vi.fluent.models.PrivateLinkResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of private link resources. + */ +@Fluent +public final class PrivateLinkResourceListResult implements JsonSerializable { + /* + * Array of private link resources + */ + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + private String nextLink; + + /** + * Creates an instance of PrivateLinkResourceListResult class. + */ + public PrivateLinkResourceListResult() { + } + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array 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: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceListResult. + */ + public static PrivateLinkResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceListResult deserializedPrivateLinkResourceListResult + = new PrivateLinkResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); + deserializedPrivateLinkResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateLinkResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceListResult; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkResources.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkResources.java new file mode 100644 index 000000000000..3b9c2d82906b --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkResources.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.vi.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 PrivateLinkResources. + */ +public interface PrivateLinkResources { + /** + * List all private link resources in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of private link resources as paginated response with {@link PagedIterable}. + */ + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * List all private link resources in a Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of private link resources as paginated response with {@link PagedIterable}. + */ + PagedIterable listByAccount(String resourceGroupName, String accountName, Context context); + + /** + * Get the private link resource with the specified group Id associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param groupId The group ID 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 the private link resource with the specified group Id associated with the Video Indexer account along + * with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, String groupId, + Context context); + + /** + * Get the private link resource with the specified group Id associated with the Video Indexer account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of the Azure Video Indexer account. + * @param groupId The group ID 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 the private link resource with the specified group Id associated with the Video Indexer account. + */ + PrivateLinkResource get(String resourceGroupName, String accountName, String groupId); +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkServiceConnectionState.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..994f0812ab90 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A collection of information about the state of the connection between service consumer and provider. + */ +@Fluent +public final class PrivateLinkServiceConnectionState implements JsonSerializable { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + */ + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + private String description; + + /* + * A message indicating if changes on the service provider require any updates on the consumer. + */ + private String actionsRequired; + + /** + * Creates an instance of PrivateLinkServiceConnectionState class. + */ + public PrivateLinkServiceConnectionState() { + } + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @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 String 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(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("actionsRequired", this.actionsRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status + = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/ProvisioningState.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/ProvisioningState.java new file mode 100644 index 000000000000..36bff363a89a --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/ProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Gets the status of the account at the time the operation was called. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * 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"); + + /** + * Static value Accepted for ProvisioningState. + */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Static value Provisioning for ProvisioningState. + */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Static value Deleting for ProvisioningState. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PublicNetworkAccess.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PublicNetworkAccess.java new file mode 100644 index 000000000000..e65575261735 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/PublicNetworkAccess.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.vi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Whether or not public network access is allowed for the account. + */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** + * Static value Enabled for PublicNetworkAccess. + */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for PublicNetworkAccess. + */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PublicNetworkAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicNetworkAccess() { + } + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * Gets known PublicNetworkAccess values. + * + * @return known PublicNetworkAccess values. + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Reason.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Reason.java new file mode 100644 index 000000000000..bd6d77da941f --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Reason.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.vi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Gets the reason that a Video Indexer account name could not be used. The Reason element is only returned if + * NameAvailable is false. + */ +public final class Reason extends ExpandableStringEnum { + /** + * Static value AlreadyExists for Reason. + */ + public static final Reason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates a new instance of Reason value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Reason() { + } + + /** + * Creates or finds a Reason from its string representation. + * + * @param name a name to look for. + * @return the corresponding Reason. + */ + public static Reason fromString(String name) { + return fromString(name, Reason.class); + } + + /** + * Gets known Reason values. + * + * @return known Reason values. + */ + public static Collection values() { + return values(Reason.class); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Scope.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Scope.java new file mode 100644 index 000000000000..618b56cb58a9 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Scope.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.vi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The requested media type. + */ +public final class Scope extends ExpandableStringEnum { + /** + * Static value Video for Scope. + */ + public static final Scope VIDEO = fromString("Video"); + + /** + * Static value Account for Scope. + */ + public static final Scope ACCOUNT = fromString("Account"); + + /** + * Static value Project for Scope. + */ + public static final Scope PROJECT = fromString("Project"); + + /** + * Creates a new instance of Scope value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Scope() { + } + + /** + * Creates or finds a Scope from its string representation. + * + * @param name a name to look for. + * @return the corresponding Scope. + */ + public static Scope fromString(String name) { + return fromString(name, Scope.class); + } + + /** + * Gets known Scope values. + * + * @return known Scope values. + */ + public static Collection values() { + return values(Scope.class); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/StorageServicesForPatchRequest.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/StorageServicesForPatchRequest.java new file mode 100644 index 000000000000..5f50cac9b89b --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/StorageServicesForPatchRequest.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The storage services details. + */ +@Fluent +public final class StorageServicesForPatchRequest implements JsonSerializable { + /* + * The user assigned identity to be used to grant permissions + */ + private String userAssignedIdentity; + + /** + * Creates an instance of StorageServicesForPatchRequest class. + */ + public StorageServicesForPatchRequest() { + } + + /** + * Get the userAssignedIdentity property: The user assigned identity to be used to grant permissions. + * + * @return the userAssignedIdentity value. + */ + public String userAssignedIdentity() { + return this.userAssignedIdentity; + } + + /** + * Set the userAssignedIdentity property: The user assigned identity to be used to grant permissions. + * + * @param userAssignedIdentity the userAssignedIdentity value to set. + * @return the StorageServicesForPatchRequest object itself. + */ + public StorageServicesForPatchRequest withUserAssignedIdentity(String userAssignedIdentity) { + this.userAssignedIdentity = userAssignedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userAssignedIdentity", this.userAssignedIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageServicesForPatchRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageServicesForPatchRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageServicesForPatchRequest. + */ + public static StorageServicesForPatchRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageServicesForPatchRequest deserializedStorageServicesForPatchRequest + = new StorageServicesForPatchRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userAssignedIdentity".equals(fieldName)) { + deserializedStorageServicesForPatchRequest.userAssignedIdentity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageServicesForPatchRequest; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/StorageServicesForPutRequest.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/StorageServicesForPutRequest.java new file mode 100644 index 000000000000..2df65d5f9e84 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/StorageServicesForPutRequest.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The storage services details. + */ +@Fluent +public final class StorageServicesForPutRequest implements JsonSerializable { + /* + * The storage services resource id + */ + private String resourceId; + + /* + * The user assigned identity to be used to grant permissions + */ + private String userAssignedIdentity; + + /** + * Creates an instance of StorageServicesForPutRequest class. + */ + public StorageServicesForPutRequest() { + } + + /** + * Get the resourceId property: The storage services resource id. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The storage services resource id. + * + * @param resourceId the resourceId value to set. + * @return the StorageServicesForPutRequest object itself. + */ + public StorageServicesForPutRequest withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the userAssignedIdentity property: The user assigned identity to be used to grant permissions. + * + * @return the userAssignedIdentity value. + */ + public String userAssignedIdentity() { + return this.userAssignedIdentity; + } + + /** + * Set the userAssignedIdentity property: The user assigned identity to be used to grant permissions. + * + * @param userAssignedIdentity the userAssignedIdentity value to set. + * @return the StorageServicesForPutRequest object itself. + */ + public StorageServicesForPutRequest withUserAssignedIdentity(String userAssignedIdentity) { + this.userAssignedIdentity = userAssignedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("userAssignedIdentity", this.userAssignedIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageServicesForPutRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageServicesForPutRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageServicesForPutRequest. + */ + public static StorageServicesForPutRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageServicesForPutRequest deserializedStorageServicesForPutRequest = new StorageServicesForPutRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedStorageServicesForPutRequest.resourceId = reader.getString(); + } else if ("userAssignedIdentity".equals(fieldName)) { + deserializedStorageServicesForPutRequest.userAssignedIdentity = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageServicesForPutRequest; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Tags.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Tags.java new file mode 100644 index 000000000000..4073e7c36efb --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Tags.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.vi.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Resource tags. + */ +@Fluent +public class Tags implements JsonSerializable { + /* + * Resource tags + */ + private Map tags; + + /** + * Creates an instance of Tags class. + */ + public Tags() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the Tags object itself. + */ + public Tags withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Tags from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Tags if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Tags. + */ + public static Tags fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Tags deserializedTags = new Tags(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedTags.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedTags; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Type.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Type.java new file mode 100644 index 000000000000..4e9c5dff644c --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/Type.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.vi.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of resource, Microsoft.VideoIndexer/accounts. + */ +public final class Type extends ExpandableStringEnum { + /** + * Static value Microsoft.VideoIndexer/accounts for Type. + */ + public static final Type MICROSOFT_VIDEO_INDEXER_ACCOUNTS = fromString("Microsoft.VideoIndexer/accounts"); + + /** + * Creates a new instance of Type value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Type() { + } + + /** + * Creates or finds a Type from its string representation. + * + * @param name a name to look for. + * @return the corresponding Type. + */ + public static Type fromString(String name) { + return fromString(name, Type.class); + } + + /** + * Gets known Type values. + * + * @return known Type values. + */ + public static Collection values() { + return values(Type.class); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/UserAssignedIdentity.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..6bea53eed1ee --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/UserAssignedIdentity.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.vi.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.UUID; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + private UUID clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/package-info.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/package-info.java new file mode 100644 index 000000000000..b08f8f04831a --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/models/package-info.java @@ -0,0 +1,9 @@ +// 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 ViManagementClient. + * Microsoft Azure Video Indexer. + */ +package com.azure.resourcemanager.vi.models; diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/package-info.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/package-info.java new file mode 100644 index 000000000000..1c7d91a2dd8c --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/com/azure/resourcemanager/vi/package-info.java @@ -0,0 +1,9 @@ +// 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 ViManagementClient. + * Microsoft Azure Video Indexer. + */ +package com.azure.resourcemanager.vi; diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/java/module-info.java b/sdk/vi/azure-resourcemanager-vi/src/main/java/module-info.java new file mode 100644 index 000000000000..1694fe2030e5 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/java/module-info.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.vi { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.vi; + exports com.azure.resourcemanager.vi.fluent; + exports com.azure.resourcemanager.vi.fluent.models; + exports com.azure.resourcemanager.vi.models; + + opens com.azure.resourcemanager.vi.fluent.models to com.azure.core; + opens com.azure.resourcemanager.vi.models to com.azure.core; +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-vi/proxy-config.json b/sdk/vi/azure-resourcemanager-vi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-vi/proxy-config.json new file mode 100644 index 000000000000..939c4890dc65 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-vi/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.vi.implementation.AccountsClientImpl$AccountsService"],["com.azure.resourcemanager.vi.implementation.GeneratesClientImpl$GeneratesService"],["com.azure.resourcemanager.vi.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.vi.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.vi.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"]] \ No newline at end of file diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-vi/reflect-config.json b/sdk/vi/azure-resourcemanager-vi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-vi/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-vi/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/vi/azure-resourcemanager-vi/src/main/resources/azure-resourcemanager-vi.properties b/sdk/vi/azure-resourcemanager-vi/src/main/resources/azure-resourcemanager-vi.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/main/resources/azure-resourcemanager-vi.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsCheckNameAvailabilitySamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsCheckNameAvailabilitySamples.java new file mode 100644 index 000000000000..bbe99cddfee3 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsCheckNameAvailabilitySamples.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.vi.generated; + +import com.azure.resourcemanager.vi.models.AccountCheckNameAvailabilityParameters; +import com.azure.resourcemanager.vi.models.Type; + +/** + * Samples for Accounts CheckNameAvailability. + */ +public final class AccountsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViAccountCheckNameAvailabilityFree.json + */ + /** + * Sample code: Check free account name availability. + * + * @param manager Entry point to ViManager. + */ + public static void checkFreeAccountNameAvailability(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .checkNameAvailabilityWithResponse(new AccountCheckNameAvailabilityParameters().withName("vi1") + .withType(Type.MICROSOFT_VIDEO_INDEXER_ACCOUNTS), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViAccountCheckNameAvailabilityTaken.json + */ + /** + * Sample code: Check taken account name availability. + * + * @param manager Entry point to ViManager. + */ + public static void checkTakenAccountNameAvailability(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .checkNameAvailabilityWithResponse(new AccountCheckNameAvailabilityParameters().withName("vi1") + .withType(Type.MICROSOFT_VIDEO_INDEXER_ACCOUNTS), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsCreateOrUpdateSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..3541af64b7a5 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsCreateOrUpdateSamples.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.vi.generated; + +import com.azure.resourcemanager.vi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.vi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.vi.models.OpenAiServicesForPutRequest; +import com.azure.resourcemanager.vi.models.StorageServicesForPutRequest; +import com.azure.resourcemanager.vi.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Accounts CreateOrUpdate. + */ +public final class AccountsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountPut/ + * ConnectClassicAccountToArmAccountUsingSystemAssignedMI.json + */ + /** + * Sample code: Connect classic account to arm account using system assigned Mi. + * + * @param manager Entry point to ViManager. + */ + public static void + connectClassicAccountToArmAccountUsingSystemAssignedMi(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .define("contosto-videoanalyzer") + .withRegion("NorthEurope") + .withExistingResourceGroup("contosto-videoanalyzer-rg") + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withAccountId("462af7c5-d1f6-4b91-86e3-8bc5e8a61574") + .withStorageServices(new StorageServicesForPutRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.Storage/storageAccounts/contoso-videoanalyzer-ms")) + .create(); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountPut/ + * ConnectClassicAccountToArmAccountUsingUserAssignedMi.json + */ + /** + * Sample code: Connect classic account to arm account using user assigned Mi. + * + * @param manager Entry point to ViManager. + */ + public static void + connectClassicAccountToArmAccountUsingUserAssignedMi(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .define("contosto-videoanalyzer") + .withRegion("NorthEurope") + .withExistingResourceGroup("contosto-videoanalyzer-rg") + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi", + new UserAssignedIdentity()))) + .withAccountId("462af7c5-d1f6-4b91-86e3-8bc5e8a61574") + .withStorageServices(new StorageServicesForPutRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.Storage/storageAccounts/contoso-videoanalyzer-ms") + .withUserAssignedIdentity( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi")) + .create(); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountPut/ + * CreateOrUpdateAccountWithUserAssignedMi.json + */ + /** + * Sample code: Create or update account with user assigned Mi. + * + * @param manager Entry point to ViManager. + */ + public static void createOrUpdateAccountWithUserAssignedMi(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .define("contosto-videoanalyzer") + .withRegion("NorthEurope") + .withExistingResourceGroup("contosto-videoanalyzer-rg") + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi", + new UserAssignedIdentity(), + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi2", + new UserAssignedIdentity()))) + .withStorageServices(new StorageServicesForPutRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.Storage/storageAccounts/contoso-videoanalyzer-ms") + .withUserAssignedIdentity( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi")) + .withOpenAiServices(new OpenAiServicesForPutRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.CognitiveServices/accounts/contoso-viopenai-ms") + .withUserAssignedIdentity( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi2")) + .create(); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountPut/ + * CreateOrUpdateAccountWithSystemAssignedMi.json + */ + /** + * Sample code: Create or update account with system assigned Mi. + * + * @param manager Entry point to ViManager. + */ + public static void createOrUpdateAccountWithSystemAssignedMi(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .define("contosto-videoanalyzer") + .withRegion("NorthEurope") + .withExistingResourceGroup("contosto-videoanalyzer-rg") + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withStorageServices(new StorageServicesForPutRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.Storage/storageAccounts/contoso-videoanalyzer-ms")) + .withOpenAiServices(new OpenAiServicesForPutRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.CognitiveServices/accounts/contoso-viopenai-ms")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsDeleteSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsDeleteSamples.java new file mode 100644 index 000000000000..ff2292cea17a --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsDeleteSamples.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.vi.generated; + +/** + * Samples for Accounts Delete. + */ +public final class AccountsDeleteSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountDelete.json + */ + /** + * Sample code: Delete account. + * + * @param manager Entry point to ViManager. + */ + public static void deleteAccount(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .deleteByResourceGroupWithResponse("contoso-rg", "contosto-videoanalyzer", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsGetByResourceGroupSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..b270510981be --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsGetByResourceGroupSamples.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.vi.generated; + +/** + * Samples for Accounts GetByResourceGroup. + */ +public final class AccountsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountGet.json + */ + /** + * Sample code: Get account. + * + * @param manager Entry point to ViManager. + */ + public static void getAccount(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts() + .getByResourceGroupWithResponse("contoso-rg", "contosto-videoanalyzer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsListByResourceGroupSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsListByResourceGroupSamples.java new file mode 100644 index 000000000000..551af9193f0f --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsListByResourceGroupSamples.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.vi.generated; + +/** + * Samples for Accounts ListByResourceGroup. + */ +public final class AccountsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountsListByResourceGroup + * .json + */ + /** + * Sample code: List accounts by resource group. + * + * @param manager Entry point to ViManager. + */ + public static void listAccountsByResourceGroup(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts().listByResourceGroup("contoso-videoanalyzer-rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsListSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsListSamples.java new file mode 100644 index 000000000000..4b11f8aa060f --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsListSamples.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.vi.generated; + +/** + * Samples for Accounts List. + */ +public final class AccountsListSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountsList.json + */ + /** + * Sample code: List accounts. + * + * @param manager Entry point to ViManager. + */ + public static void listAccounts(com.azure.resourcemanager.vi.ViManager manager) { + manager.accounts().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsUpdateSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsUpdateSamples.java new file mode 100644 index 000000000000..c10035fbaaf3 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/AccountsUpdateSamples.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.generated; + +import com.azure.resourcemanager.vi.models.Account; +import com.azure.resourcemanager.vi.models.ManagedServiceIdentity; +import com.azure.resourcemanager.vi.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.vi.models.OpenAiServicesForPatchRequest; +import com.azure.resourcemanager.vi.models.StorageServicesForPatchRequest; +import com.azure.resourcemanager.vi.models.UserAssignedIdentity; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Accounts Update. + */ +public final class AccountsUpdateSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountPatch/ + * PatchAccountWithUserAssignedMi.json + */ + /** + * Sample code: Patch account with user assigned Mi. + * + * @param manager Entry point to ViManager. + */ + public static void patchAccountWithUserAssignedMi(com.azure.resourcemanager.vi.ViManager manager) { + Account resource = manager.accounts() + .getByResourceGroupWithResponse("contosto-videoanalyzer-rg", "contosto-videoanalyzer", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi", + new UserAssignedIdentity(), + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi2", + new UserAssignedIdentity()))) + .withStorageServices(new StorageServicesForPatchRequest().withUserAssignedIdentity( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi")) + .withOpenAiServices(new OpenAiServicesForPatchRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.CognitiveServices/accounts/contoso-viopenai-ms") + .withUserAssignedIdentity( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-videoanalyzer-mi2")) + .apply(); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViAccountPatch/ + * PatchAccountWithSystemAssignedMi.json + */ + /** + * Sample code: Patch account with system assigned Mi. + * + * @param manager Entry point to ViManager. + */ + public static void patchAccountWithSystemAssignedMi(com.azure.resourcemanager.vi.ViManager manager) { + Account resource = manager.accounts() + .getByResourceGroupWithResponse("contoso-videoanalyzer-rg", "contosto-videoanalyzer", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withStorageServices(new StorageServicesForPatchRequest()) + .withOpenAiServices(new OpenAiServicesForPatchRequest().withResourceId( + "/subscriptions/xxx/resourceGroups/contoso-videoanalyzer-rg/providers/Microsoft.CognitiveServices/accounts/contoso-viopenai-ms")) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateAccessTokenSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateAccessTokenSamples.java new file mode 100644 index 000000000000..d8e772ba26e4 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateAccessTokenSamples.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.generated; + +import com.azure.resourcemanager.vi.models.GenerateAccessTokenParameters; +import com.azure.resourcemanager.vi.models.PermissionType; +import com.azure.resourcemanager.vi.models.Scope; + +/** + * Samples for Generate AccessToken. + */ +public final class GenerateAccessTokenSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViGenerateAccessToken/ + * ViGenerateProjectContributerAccessToken.json + */ + /** + * Sample code: Generate accessToken for project contributor. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForProjectContributor(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .accessTokenWithResponse("contosto-videoanalyzer-rg", "contosto-videoanalyzer", + new GenerateAccessTokenParameters().withPermissionType(PermissionType.CONTRIBUTOR) + .withScope(Scope.PROJECT) + .withProjectId("07ec9e38d4"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViGenerateAccessToken/ + * ViGenerateProjectReaderAccessToken.json + */ + /** + * Sample code: Generate accessToken for project reader. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForProjectReader(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .accessTokenWithResponse("contosto-videoanalyzer-rg", "contosto-videoanalyzer", + new GenerateAccessTokenParameters().withPermissionType(PermissionType.READER) + .withScope(Scope.PROJECT) + .withProjectId("07ec9e38d4"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViGenerateAccessToken/ + * ViGenerateAccountContributerAccessToken.json + */ + /** + * Sample code: Generate accessToken for account contributor. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForAccountContributor(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .accessTokenWithResponse("contosto-videoanalyzer-rg", "contosto-videoanalyzer", + new GenerateAccessTokenParameters().withPermissionType(PermissionType.CONTRIBUTOR) + .withScope(Scope.ACCOUNT), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViGenerateAccessToken/ + * ViGenerateAccountReaderAccessToken.json + */ + /** + * Sample code: Generate accessToken for account reader. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForAccountReader(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .accessTokenWithResponse("contosto-videoanalyzer-rg", "contosto-videoanalyzer", + new GenerateAccessTokenParameters().withPermissionType(PermissionType.READER).withScope(Scope.ACCOUNT), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViGenerateAccessToken/ + * ViGenerateVideoContributerAccessToken.json + */ + /** + * Sample code: Generate accessToken for video contributor. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForVideoContributor(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .accessTokenWithResponse("contosto-videoanalyzer-rg", "contosto-videoanalyzer", + new GenerateAccessTokenParameters().withPermissionType(PermissionType.CONTRIBUTOR) + .withScope(Scope.VIDEO) + .withVideoId("07ec9e38d4"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViGenerateAccessToken/ + * ViGenerateVideoReaderAccessToken.json + */ + /** + * Sample code: Generate accessToken for video reader. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForVideoReader(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .accessTokenWithResponse("contosto-videoanalyzer-rg", "contosto-videoanalyzer", + new GenerateAccessTokenParameters().withPermissionType(PermissionType.READER) + .withScope(Scope.VIDEO) + .withVideoId("07ec9e38d4"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateExtensionAccessTokenSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateExtensionAccessTokenSamples.java new file mode 100644 index 000000000000..396b6338c7e1 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateExtensionAccessTokenSamples.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.generated; + +import com.azure.resourcemanager.vi.models.GenerateExtensionAccessTokenParameters; +import com.azure.resourcemanager.vi.models.PermissionType; +import com.azure.resourcemanager.vi.models.Scope; + +/** + * Samples for Generate ExtensionAccessToken. + */ +public final class GenerateExtensionAccessTokenSamples { + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateExtensionAccessToken/ViGenerateAccountContributerAccessToken.json + */ + /** + * Sample code: Generate accessToken for account contributor. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForAccountContributor(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .extensionAccessTokenWithResponse("contoso-videoindexer-rg", "contoso-videoindexer", + new GenerateExtensionAccessTokenParameters().withPermissionType(PermissionType.CONTRIBUTOR) + .withScope(Scope.ACCOUNT) + .withExtensionId( + "/subscriptions/39ks012-8546-4da5-g6w0-8c3cb76dd930/resourceGroups/yl-arc/providers/Microsoft.Kubernetes/ConnectedClusters/yl-arc/providers/Microsoft.KubernetesConfiguration/extensions/exampleid"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateExtensionAccessToken/ViGenerateAccountReaderAccessToken.json + */ + /** + * Sample code: Generate accessToken for account reader. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForAccountReader(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .extensionAccessTokenWithResponse("contoso-videoindexer-rg", "contoso-videoindexer", + new GenerateExtensionAccessTokenParameters().withPermissionType(PermissionType.READER) + .withScope(Scope.ACCOUNT) + .withExtensionId( + "/subscriptions/39ks012-8546-4da5-g6w0-8c3cb76dd930/resourceGroups/yl-arc/providers/Microsoft.Kubernetes/ConnectedClusters/yl-arc/providers/Microsoft.KubernetesConfiguration/extensions/exampleid"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateExtensionAccessToken/ViGenerateVideoContributerAccessToken.json + */ + /** + * Sample code: Generate accessToken for video contributor. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForVideoContributor(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .extensionAccessTokenWithResponse("contoso-videoindexer-rg", "contoso-videoindexer", + new GenerateExtensionAccessTokenParameters().withPermissionType(PermissionType.CONTRIBUTOR) + .withScope(Scope.VIDEO) + .withExtensionId( + "/subscriptions/39ks012-8546-4da5-g6w0-8c3cb76dd930/resourceGroups/yl-arc/providers/Microsoft.Kubernetes/ConnectedClusters/yl-arc/providers/Microsoft.KubernetesConfiguration/extensions/exampleid") + .withVideoId("07ec9e38d4") + .withTokenLifetimeInSeconds(3600), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateExtensionAccessToken/ViGenerateVideoReaderAccessToken.json + */ + /** + * Sample code: Generate accessToken for video reader. + * + * @param manager Entry point to ViManager. + */ + public static void generateAccessTokenForVideoReader(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .extensionAccessTokenWithResponse("contoso-videoindexer-rg", "contoso-videoindexer", + new GenerateExtensionAccessTokenParameters().withPermissionType(PermissionType.READER) + .withScope(Scope.VIDEO) + .withExtensionId( + "/subscriptions/39ks012-8546-4da5-g6w0-8c3cb76dd930/resourceGroups/yl-arc/providers/Microsoft.Kubernetes/ConnectedClusters/yl-arc/providers/Microsoft.KubernetesConfiguration/extensions/exampleid") + .withVideoId("07ec9e38d4") + .withTokenLifetimeInSeconds(3600), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateExtensionRestrictedViewerAccessTokenSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateExtensionRestrictedViewerAccessTokenSamples.java new file mode 100644 index 000000000000..2d46511e6498 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateExtensionRestrictedViewerAccessTokenSamples.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.vi.generated; + +import com.azure.resourcemanager.vi.models.GenerateExtensionRestrictedViewerAccessTokenParameters; +import com.azure.resourcemanager.vi.models.Scope; + +/** + * Samples for Generate ExtensionRestrictedViewerAccessToken. + */ +public final class GenerateExtensionRestrictedViewerAccessTokenSamples { + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateExtensionRestrictedViewerAccessToken/ViGenerateAccountRestrictedViewerAccessToken.json + */ + /** + * Sample code: Generate restricted viewer accessToken for account. + * + * @param manager Entry point to ViManager. + */ + public static void generateRestrictedViewerAccessTokenForAccount(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .extensionRestrictedViewerAccessTokenWithResponse("contosto-azurevideoindexer-rg", + "contosto-azurevideoindexer", + new GenerateExtensionRestrictedViewerAccessTokenParameters().withScope(Scope.ACCOUNT) + .withExtensionId( + "/subscriptions/39ks012-8546-4da5-g6w0-8c3cb76dd930/resourceGroups/yl-arc/providers/Microsoft.Kubernetes/ConnectedClusters/yl-arc/providers/Microsoft.KubernetesConfiguration/extensions/exampleid"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateExtensionRestrictedViewerAccessToken/ViGenerateVideoRestrictedViewerAccessToken.json + */ + /** + * Sample code: Generate restricted viewer accessToken for video #1. + * + * @param manager Entry point to ViManager. + */ + public static void generateRestrictedViewerAccessTokenForVideo1(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .extensionRestrictedViewerAccessTokenWithResponse("contosto-azurevideoindexer-rg", + "contosto-azurevideoindexer", + new GenerateExtensionRestrictedViewerAccessTokenParameters().withScope(Scope.VIDEO) + .withExtensionId( + "/subscriptions/39ks012-8546-4da5-g6w0-8c3cb76dd930/resourceGroups/yl-arc/providers/Microsoft.Kubernetes/ConnectedClusters/yl-arc/providers/Microsoft.KubernetesConfiguration/extensions/exampleid") + .withVideoId("07ec9e38d4") + .withTokenLifetimeInSeconds(3600), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateRestrictedViewerAccessTokenSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateRestrictedViewerAccessTokenSamples.java new file mode 100644 index 000000000000..1702599a8ab6 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/GenerateRestrictedViewerAccessTokenSamples.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.vi.generated; + +import com.azure.resourcemanager.vi.models.GenerateRestrictedViewerAccessTokenParameters; +import com.azure.resourcemanager.vi.models.Scope; + +/** + * Samples for Generate RestrictedViewerAccessToken. + */ +public final class GenerateRestrictedViewerAccessTokenSamples { + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateRestrictedViewerAccessToken/ViGenerateVideoRestrictedViewerAccessToken.json + */ + /** + * Sample code: Generate restricted viewer accessToken for video. + * + * @param manager Entry point to ViManager. + */ + public static void generateRestrictedViewerAccessTokenForVideo(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .restrictedViewerAccessTokenWithResponse("contosto-azurevideoindexer-rg", "contosto-azurevideoindexer", + new GenerateRestrictedViewerAccessTokenParameters().withScope(Scope.VIDEO).withVideoId("07ec9e38d4"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateRestrictedViewerAccessToken/ViGenerateAccountRestrictedViewerAccessToken.json + */ + /** + * Sample code: Generate restricted viewer accessToken for account. + * + * @param manager Entry point to ViManager. + */ + public static void generateRestrictedViewerAccessTokenForAccount(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .restrictedViewerAccessTokenWithResponse("contosto-azurevideoindexer-rg", "contosto-azurevideoindexer", + new GenerateRestrictedViewerAccessTokenParameters().withScope(Scope.ACCOUNT), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ + * ViGenerateRestrictedViewerAccessToken/ViGenerateProjectRestrictedViewerAccessToken.json + */ + /** + * Sample code: Generate restricted viewer accessToken for project. + * + * @param manager Entry point to ViManager. + */ + public static void generateRestrictedViewerAccessTokenForProject(com.azure.resourcemanager.vi.ViManager manager) { + manager.generates() + .restrictedViewerAccessTokenWithResponse("contosto-azurevideoindexer-rg", "contosto-azurevideoindexer", + new GenerateRestrictedViewerAccessTokenParameters().withScope(Scope.PROJECT) + .withProjectId("07ec9e38d4"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/OperationsListSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/OperationsListSamples.java new file mode 100644 index 000000000000..66d0ccc357a3 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/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.vi.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/ViOperationsList.json + */ + /** + * Sample code: List operations. + * + * @param manager Entry point to ViManager. + */ + public static void listOperations(com.azure.resourcemanager.vi.ViManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..7340159f326f --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.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.vi.generated; + +import com.azure.resourcemanager.vi.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.vi.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections CreateOrUpdate. + */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/PrivateEndpointConnections/ + * PrivateEndpointConnection_CreateOrUpdate.json + */ + /** + * Sample code: PrivateEndpointConnectionCreateOrUpdate. + * + * @param manager Entry point to ViManager. + */ + public static void privateEndpointConnectionCreateOrUpdate(com.azure.resourcemanager.vi.ViManager manager) { + manager.privateEndpointConnections() + .define("peexample01") + .withExistingAccount("test-rg", "contoso") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..2f537ffea0ea --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateEndpointConnectionsDeleteSamples.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.vi.generated; + +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/PrivateEndpointConnections/ + * PrivateEndpointConnection_Delete.json + */ + /** + * Sample code: PrivateEndpointConnectionDelete. + * + * @param manager Entry point to ViManager. + */ + public static void privateEndpointConnectionDelete(com.azure.resourcemanager.vi.ViManager manager) { + manager.privateEndpointConnections() + .delete("test-rg", "contoso", "peexample01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..4dc906e78d05 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/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.vi.generated; + +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/PrivateEndpointConnections/ + * PrivateEndpointConnection_Get.json + */ + /** + * Sample code: PrivateEndpointConnectionGet. + * + * @param manager Entry point to ViManager. + */ + public static void privateEndpointConnectionGet(com.azure.resourcemanager.vi.ViManager manager) { + manager.privateEndpointConnections() + .getWithResponse("test-rg", "contoso", "peexample01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateEndpointConnectionsListByAccountSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateEndpointConnectionsListByAccountSamples.java new file mode 100644 index 000000000000..261396ff48b0 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateEndpointConnectionsListByAccountSamples.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.vi.generated; + +/** + * Samples for PrivateEndpointConnections ListByAccount. + */ +public final class PrivateEndpointConnectionsListByAccountSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/PrivateEndpointConnections/ + * PrivateEndpointConnection_ListByAccount.json + */ + /** + * Sample code: PrivateEndpointConnectionList. + * + * @param manager Entry point to ViManager. + */ + public static void privateEndpointConnectionList(com.azure.resourcemanager.vi.ViManager manager) { + manager.privateEndpointConnections().listByAccount("test-rg", "contoso", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateLinkResourcesGetSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateLinkResourcesGetSamples.java new file mode 100644 index 000000000000..7b962e0cc0b1 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateLinkResourcesGetSamples.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.vi.generated; + +/** + * Samples for PrivateLinkResources Get. + */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/PrivateLinkResources/ + * PrivateLinkResources_Get.json + */ + /** + * Sample code: PrivateLinkResourcesGet. + * + * @param manager Entry point to ViManager. + */ + public static void privateLinkResourcesGet(com.azure.resourcemanager.vi.ViManager manager) { + manager.privateLinkResources().getWithResponse("test-rg", "contoso", "avi", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateLinkResourcesListByAccountSamples.java b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateLinkResourcesListByAccountSamples.java new file mode 100644 index 000000000000..60d00a1a24f1 --- /dev/null +++ b/sdk/vi/azure-resourcemanager-vi/src/samples/java/com/azure/resourcemanager/vi/generated/PrivateLinkResourcesListByAccountSamples.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.vi.generated; + +/** + * Samples for PrivateLinkResources ListByAccount. + */ +public final class PrivateLinkResourcesListByAccountSamples { + /* + * x-ms-original-file: + * specification/vi/resource-manager/Microsoft.VideoIndexer/stable/2025-04-01/examples/PrivateLinkResources/ + * PrivateLinkResources_ListByAccount.json + */ + /** + * Sample code: PrivateLinkResourcesList. + * + * @param manager Entry point to ViManager. + */ + public static void privateLinkResourcesList(com.azure.resourcemanager.vi.ViManager manager) { + manager.privateLinkResources().listByAccount("test-rg", "contoso", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/vi/ci.yml b/sdk/vi/ci.yml new file mode 100644 index 000000000000..c4e596b9b67c --- /dev/null +++ b/sdk/vi/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/vi/ci.yml + - sdk/vi/azure-resourcemanager-vi/ + exclude: + - sdk/vi/pom.xml + - sdk/vi/azure-resourcemanager-vi/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/vi/ci.yml + - sdk/vi/azure-resourcemanager-vi/ + exclude: + - sdk/vi/pom.xml + - sdk/vi/azure-resourcemanager-vi/pom.xml + +parameters: + - name: release_azureresourcemanagervi + displayName: azure-resourcemanager-vi + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: vi + Artifacts: + - name: azure-resourcemanager-vi + groupId: com.azure.resourcemanager + safeName: azureresourcemanagervi + releaseInBatch: ${{ parameters.release_azureresourcemanagervi }} diff --git a/sdk/vi/pom.xml b/sdk/vi/pom.xml new file mode 100644 index 000000000000..eb34cf36c834 --- /dev/null +++ b/sdk/vi/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-vi-service + pom + 1.0.0 + + + azure-resourcemanager-vi + +