diff --git a/pom.xml b/pom.xml index 0727ad1c393f..51a0cef029f1 100644 --- a/pom.xml +++ b/pom.xml @@ -120,6 +120,7 @@ sdk/extendedlocation sdk/fabric sdk/face + sdk/fileshares sdk/fluidrelay sdk/formrecognizer sdk/frontdoor diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/CHANGELOG.md b/sdk/fileshares/azure-resourcemanager-fileshares/CHANGELOG.md new file mode 100644 index 000000000000..19d2041fb3b6 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/CHANGELOG.md @@ -0,0 +1,10 @@ +# Release History + +## 1.0.0-beta.1 (2026-04-29) + +- Azure Resource Manager fileshares client library for Java. This package contains Microsoft Azure SDK for fileshares Management SDK. Azure File Shares Resource Provider API. Package api-version 2026-06-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 of the Azure Resource Manager FileShares client library for Java. + diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/README.md b/sdk/fileshares/azure-resourcemanager-fileshares/README.md new file mode 100644 index 000000000000..82d8792743f8 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager fileshares client library for Java + +Azure Resource Manager fileshares client library for Java. + +This package contains Microsoft Azure SDK for fileshares Management SDK. Azure File Shares Resource Provider API. Package api-version 2026-06-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-fileshares;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-fileshares + 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(); +FilesharesManager manager = FilesharesManager + .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/fileshares/azure-resourcemanager-fileshares/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/fileshares/azure-resourcemanager-fileshares/SAMPLE.md b/sdk/fileshares/azure-resourcemanager-fileshares/SAMPLE.md new file mode 100644 index 000000000000..38fcfa2a420e --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/SAMPLE.md @@ -0,0 +1,776 @@ +# Code snippets and samples + + +## FileShareSnapshots + +- [CreateOrUpdateFileShareSnapshot](#filesharesnapshots_createorupdatefilesharesnapshot) +- [DeleteFileShareSnapshot](#filesharesnapshots_deletefilesharesnapshot) +- [GetFileShareSnapshot](#filesharesnapshots_getfilesharesnapshot) +- [ListByFileShare](#filesharesnapshots_listbyfileshare) +- [UpdateFileShareSnapshot](#filesharesnapshots_updatefilesharesnapshot) + +## FileShares + +- [CheckNameAvailability](#fileshares_checknameavailability) +- [CreateOrUpdate](#fileshares_createorupdate) +- [Delete](#fileshares_delete) +- [GetByResourceGroup](#fileshares_getbyresourcegroup) +- [List](#fileshares_list) +- [ListByResourceGroup](#fileshares_listbyresourcegroup) +- [Update](#fileshares_update) + +## InformationalOperations + +- [GetLimits](#informationaloperations_getlimits) +- [GetProvisioningRecommendation](#informationaloperations_getprovisioningrecommendation) +- [GetUsageData](#informationaloperations_getusagedata) + +## Operations + +- [List](#operations_list) + +## PrivateEndpointConnections + +- [Create](#privateendpointconnections_create) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [ListByFileShare](#privateendpointconnections_listbyfileshare) + +## PrivateLinkResources + +- [Get](#privatelinkresources_get) +- [List](#privatelinkresources_list) +### FileShareSnapshots_CreateOrUpdateFileShareSnapshot + +```java +import com.azure.resourcemanager.fileshares.models.FileShareSnapshotProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FileShareSnapshots CreateOrUpdateFileShareSnapshot. + */ +public final class FileShareSnapshotsCreateOrUpdateFileShareSnapshotSamples { + /* + * x-ms-original-file: 2026-06-01/FileShareSnapshot_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: FileShareSnapshot_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileShareSnapshotCreateOrUpdateMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShareSnapshots() + .define("testfilesharesnapshot") + .withExistingFileShare("rgfileshares", "fileshare") + .withProperties(new FileShareSnapshotProperties().withInitiatorId("backup-vault-001") + .withMetadata(mapOf("key9372", "fakeTokenPlaceholder"))) + .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; + } +} +``` + +### FileShareSnapshots_DeleteFileShareSnapshot + +```java +/** + * Samples for FileShareSnapshots DeleteFileShareSnapshot. + */ +public final class FileShareSnapshotsDeleteFileShareSnapshotSamples { + /* + * x-ms-original-file: 2026-06-01/FileShareSnapshot_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: FileShareSnapshot_Delete_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileShareSnapshotDeleteMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShareSnapshots() + .deleteFileShareSnapshot("rgfileshares", "fileshare", "testfilesharesnapshot", + com.azure.core.util.Context.NONE); + } +} +``` + +### FileShareSnapshots_GetFileShareSnapshot + +```java +/** + * Samples for FileShareSnapshots GetFileShareSnapshot. + */ +public final class FileShareSnapshotsGetFileShareSnapshotSamples { + /* + * x-ms-original-file: 2026-06-01/FileShareSnapshot_Get_MaximumSet_Gen.json + */ + /** + * Sample code: FileShareSnapshot_Get_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareSnapshotGetMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShareSnapshots() + .getFileShareSnapshotWithResponse("rgfileshares", "fileshare", "testfilesharesnapshot", + com.azure.core.util.Context.NONE); + } +} +``` + +### FileShareSnapshots_ListByFileShare + +```java +/** + * Samples for FileShareSnapshots ListByFileShare. + */ +public final class FileShareSnapshotsListByFileShareSamples { + /* + * x-ms-original-file: 2026-06-01/FileShareSnapshot_List_MinimumSet_Gen.json + */ + /** + * Sample code: FileShareSnapshot_List_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareSnapshotListMinimumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShareSnapshots().listByFileShare("rgfileshares", "testfileshare", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/FileShareSnapshot_List_MaximumSet_Gen.json + */ + /** + * Sample code: FileShareSnapshot_List_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareSnapshotListMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShareSnapshots().listByFileShare("rgfileshares", "fileshare", com.azure.core.util.Context.NONE); + } +} +``` + +### FileShareSnapshots_UpdateFileShareSnapshot + +```java +import com.azure.resourcemanager.fileshares.models.FileShareSnapshot; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshotUpdateProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FileShareSnapshots UpdateFileShareSnapshot. + */ +public final class FileShareSnapshotsUpdateFileShareSnapshotSamples { + /* + * x-ms-original-file: 2026-06-01/FileShareSnapshot_Update_MaximumSet_Gen.json + */ + /** + * Sample code: FileShareSnapshot_Update_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileShareSnapshotUpdateMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + FileShareSnapshot resource = manager.fileShareSnapshots() + .getFileShareSnapshotWithResponse("rgfileshares", "fileshare", "testfilesharesnapshot", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties( + new FileShareSnapshotUpdateProperties().withMetadata(mapOf("key491", "fakeTokenPlaceholder"))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FileShares_CheckNameAvailability + +```java +import com.azure.resourcemanager.fileshares.models.CheckNameAvailabilityRequest; + +/** + * Samples for FileShares CheckNameAvailability. + */ +public final class FileSharesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: 2026-06-01/FileShares_CheckNameAvailability_MaximumSet_Gen.json + */ + /** + * Sample code: FileShares_CheckNameAvailability_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileSharesCheckNameAvailabilityMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares() + .checkNameAvailabilityWithResponse("westus", + new CheckNameAvailabilityRequest().withName("fvykqbgmd").withType("Microsoft.FileShares/fileShares"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/FileShares_CheckNameAvailability_MinimumSet_Gen.json + */ + /** + * Sample code: FileShares_CheckNameAvailability_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileSharesCheckNameAvailabilityMinimumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares() + .checkNameAvailabilityWithResponse("westus", new CheckNameAvailabilityRequest(), + com.azure.core.util.Context.NONE); + } +} +``` + +### FileShares_CreateOrUpdate + +```java +import com.azure.resourcemanager.fileshares.models.EncryptionInTransitRequired; +import com.azure.resourcemanager.fileshares.models.FileShareProperties; +import com.azure.resourcemanager.fileshares.models.MediaTier; +import com.azure.resourcemanager.fileshares.models.NfsProtocolProperties; +import com.azure.resourcemanager.fileshares.models.Protocol; +import com.azure.resourcemanager.fileshares.models.PublicAccessProperties; +import com.azure.resourcemanager.fileshares.models.PublicNetworkAccess; +import com.azure.resourcemanager.fileshares.models.Redundancy; +import com.azure.resourcemanager.fileshares.models.ShareRootSquash; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FileShares CreateOrUpdate. + */ +public final class FileSharesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-06-01/FileShares_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: FileShares_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileSharesCreateOrUpdateMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares() + .define("fileshare") + .withRegion("westus") + .withExistingResourceGroup("rgfileshares") + .withTags(mapOf("key9647", "fakeTokenPlaceholder")) + .withProperties(new FileShareProperties().withMountName("fileshare") + .withMediaTier(MediaTier.SSD) + .withRedundancy(Redundancy.LOCAL) + .withProtocol(Protocol.NFS) + .withProvisionedStorageGiB(8) + .withProvisionedIOPerSec(5) + .withProvisionedThroughputMiBPerSec(22) + .withNfsProtocolProperties(new NfsProtocolProperties().withRootSquash(ShareRootSquash.NO_ROOT_SQUASH) + .withEncryptionInTransitRequired(EncryptionInTransitRequired.ENABLED)) + .withPublicAccessProperties(new PublicAccessProperties().withAllowedSubnets(Arrays.asList( + "/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"))) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### FileShares_Delete + +```java +/** + * Samples for FileShares Delete. + */ +public final class FileSharesDeleteSamples { + /* + * x-ms-original-file: 2026-06-01/FileShares_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: FileShares_Delete_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileSharesDeleteMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares().delete("rgfileshares", "fileshare", com.azure.core.util.Context.NONE); + } +} +``` + +### FileShares_GetByResourceGroup + +```java +/** + * Samples for FileShares GetByResourceGroup. + */ +public final class FileSharesGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-06-01/FileShares_Get_MaximumSet_Gen.json + */ + /** + * Sample code: FileShares_Get_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileSharesGetMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares() + .getByResourceGroupWithResponse("rgfileshares", "fileshare", com.azure.core.util.Context.NONE); + } +} +``` + +### FileShares_List + +```java +/** + * Samples for FileShares List. + */ +public final class FileSharesListSamples { + /* + * x-ms-original-file: 2026-06-01/FileShares_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: FileShares_ListBySubscription_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileSharesListBySubscriptionMinimumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/FileShares_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: FileShares_ListBySubscription_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileSharesListBySubscriptionMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares().list(com.azure.core.util.Context.NONE); + } +} +``` + +### FileShares_ListByResourceGroup + +```java +/** + * Samples for FileShares ListByResourceGroup. + */ +public final class FileSharesListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-06-01/FileShares_ListByParent_MinimumSet_Gen.json + */ + /** + * Sample code: FileShares_ListByParent_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileSharesListByParentMinimumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares().listByResourceGroup("rgfileshares", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/FileShares_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: FileShares_ListByParent_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileSharesListByParentMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares().listByResourceGroup("rgfileshares", com.azure.core.util.Context.NONE); + } +} +``` + +### FileShares_Update + +```java +import com.azure.resourcemanager.fileshares.models.EncryptionInTransitRequired; +import com.azure.resourcemanager.fileshares.models.FileShare; +import com.azure.resourcemanager.fileshares.models.FileShareUpdateProperties; +import com.azure.resourcemanager.fileshares.models.NfsProtocolProperties; +import com.azure.resourcemanager.fileshares.models.PublicAccessProperties; +import com.azure.resourcemanager.fileshares.models.PublicNetworkAccess; +import com.azure.resourcemanager.fileshares.models.ShareRootSquash; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FileShares Update. + */ +public final class FileSharesUpdateSamples { + /* + * x-ms-original-file: 2026-06-01/FileShares_Update_MaximumSet_Gen.json + */ + /** + * Sample code: FileShares_Update_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileSharesUpdateMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + FileShare resource = manager.fileShares() + .getByResourceGroupWithResponse("rgfileshares", "fileshare", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key173", "fakeTokenPlaceholder")) + .withProperties(new FileShareUpdateProperties().withProvisionedStorageGiB(7) + .withProvisionedIOPerSec(1) + .withProvisionedThroughputMiBPerSec(29) + .withNfsProtocolProperties(new NfsProtocolProperties().withRootSquash(ShareRootSquash.NO_ROOT_SQUASH) + .withEncryptionInTransitRequired(EncryptionInTransitRequired.ENABLED)) + .withPublicAccessProperties(new PublicAccessProperties().withAllowedSubnets(Arrays.asList( + "/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"))) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED)) + .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; + } +} +``` + +### InformationalOperations_GetLimits + +```java +/** + * Samples for InformationalOperations GetLimits. + */ +public final class InformationalOperationsGetLimitsSamples { + /* + * x-ms-original-file: 2026-06-01/FileShare_GetLimits_MinimumSet_Gen.json + */ + /** + * Sample code: FileShare_GetLimits_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareGetLimitsMinimumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.informationalOperations().getLimitsWithResponse("westus", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/FileShare_GetLimits_MaximumSet_Gen.json + */ + /** + * Sample code: FileShare_GetLimits_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareGetLimitsMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.informationalOperations().getLimitsWithResponse("westus", com.azure.core.util.Context.NONE); + } +} +``` + +### InformationalOperations_GetProvisioningRecommendation + +```java +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationInput; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationRequest; + +/** + * Samples for InformationalOperations GetProvisioningRecommendation. + */ +public final class InformationalOperationsGetProvisioningRecommendationSamples { + /* + * x-ms-original-file: 2026-06-01/FileShare_GetProvisioningRecommendation_MaximumSet_Gen.json + */ + /** + * Sample code: FileShare_GetProvisioningRecommendation_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareGetProvisioningRecommendationMaximumSet( + com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.informationalOperations() + .getProvisioningRecommendationWithResponse("westus", + new FileShareProvisioningRecommendationRequest() + .withProperties(new FileShareProvisioningRecommendationInput().withProvisionedStorageGiB(7)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/FileShare_GetProvisioningRecommendation_MinimumSet_Gen.json + */ + /** + * Sample code: FileShare_GetProvisioningRecommendation_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareGetProvisioningRecommendationMinimumSet( + com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.informationalOperations() + .getProvisioningRecommendationWithResponse("westus", + new FileShareProvisioningRecommendationRequest() + .withProperties(new FileShareProvisioningRecommendationInput().withProvisionedStorageGiB(7)), + com.azure.core.util.Context.NONE); + } +} +``` + +### InformationalOperations_GetUsageData + +```java +/** + * Samples for InformationalOperations GetUsageData. + */ +public final class InformationalOperationsGetUsageDataSamples { + /* + * x-ms-original-file: 2026-06-01/FileShare_GetUsageData_MaximumSet_Gen.json + */ + /** + * Sample code: FileShare_GetUsageData_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareGetUsageDataMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.informationalOperations().getUsageDataWithResponse("westus", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/FileShare_GetUsageData_MinimumSet_Gen.json + */ + /** + * Sample code: FileShare_GetUsageData_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareGetUsageDataMinimumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.informationalOperations().getUsageDataWithResponse("westus", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-06-01/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void operationsListMinimumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void operationsListMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Create + +```java +import com.azure.resourcemanager.fileshares.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.fileshares.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections Create. + */ +public final class PrivateEndpointConnectionsCreateSamples { + /* + * x-ms-original-file: 2026-06-01/PrivateEndpointConnections_Create.json + */ + /** + * Sample code: PrivateEndpointConnections_Create. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + privateEndpointConnectionsCreate(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.privateEndpointConnections() + .define("privateEndpointConnection1") + .withExistingFileShare("rgfileshares", "fileshare") + .withProperties(new PrivateEndpointConnectionProperties().withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by admin"))) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: 2026-06-01/PrivateEndpointConnections_Delete.json + */ + /** + * Sample code: PrivateEndpointConnections_Delete. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + privateEndpointConnectionsDelete(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.privateEndpointConnections() + .delete("rgfileshares", "fileshare", "privateEndpointConnection1", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: 2026-06-01/PrivateEndpointConnections_Get.json + */ + /** + * Sample code: PrivateEndpointConnections_Get. + * + * @param manager Entry point to FilesharesManager. + */ + public static void privateEndpointConnectionsGet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.privateEndpointConnections() + .getWithResponse("rgfileshares", "fileshare", "privateEndpointConnection1", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_ListByFileShare + +```java +/** + * Samples for PrivateEndpointConnections ListByFileShare. + */ +public final class PrivateEndpointConnectionsListByFileShareSamples { + /* + * x-ms-original-file: 2026-06-01/PrivateEndpointConnections_ListByFileShare.json + */ + /** + * Sample code: PrivateEndpointConnections_ListByFileShare. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + privateEndpointConnectionsListByFileShare(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.privateEndpointConnections() + .listByFileShare("rgfileshares", "fileshare", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResources_Get + +```java +/** + * Samples for PrivateLinkResources Get. + */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: 2026-06-01/PrivateLinkResources_Get.json + */ + /** + * Sample code: Get PrivateLinkResource. + * + * @param manager Entry point to FilesharesManager. + */ + public static void getPrivateLinkResource(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.privateLinkResources() + .getWithResponse("res4303", "testfileshare01", "fileshare", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResources_List + +```java +/** + * Samples for PrivateLinkResources List. + */ +public final class PrivateLinkResourcesListSamples { + /* + * x-ms-original-file: 2026-06-01/PrivateLinkResources_ListByFileShare.json + */ + /** + * Sample code: List PrivateLinkResources. + * + * @param manager Entry point to FilesharesManager. + */ + public static void listPrivateLinkResources(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.privateLinkResources().list("res4303", "testfileshare01", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/pom.xml b/sdk/fileshares/azure-resourcemanager-fileshares/pom.xml new file mode 100644 index 000000000000..3f54c922c032 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-fileshares + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for fileshares Management + This package contains Microsoft Azure SDK for fileshares Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure File Shares Resource Provider API. Package api-version 2026-06-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 + + + + com.azure + azure-core + 1.57.1 + + + com.azure + azure-core-management + 1.19.3 + + + com.azure + azure-core-test + 1.27.0-beta.14 + test + + + com.azure + azure-identity + 1.18.2 + test + + + diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/FilesharesManager.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/FilesharesManager.java new file mode 100644 index 000000000000..c068206a60cc --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/FilesharesManager.java @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares; + +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.fileshares.fluent.FileSharesManagementClient; +import com.azure.resourcemanager.fileshares.implementation.FileShareSnapshotsImpl; +import com.azure.resourcemanager.fileshares.implementation.FileSharesImpl; +import com.azure.resourcemanager.fileshares.implementation.FileSharesManagementClientBuilder; +import com.azure.resourcemanager.fileshares.implementation.InformationalOperationsImpl; +import com.azure.resourcemanager.fileshares.implementation.OperationsImpl; +import com.azure.resourcemanager.fileshares.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.fileshares.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshots; +import com.azure.resourcemanager.fileshares.models.FileShares; +import com.azure.resourcemanager.fileshares.models.InformationalOperations; +import com.azure.resourcemanager.fileshares.models.Operations; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointConnections; +import com.azure.resourcemanager.fileshares.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 FilesharesManager. + * Azure File Shares Resource Provider API. + */ +public final class FilesharesManager { + private FileShares fileShares; + + private FileShareSnapshots fileShareSnapshots; + + private Operations operations; + + private InformationalOperations informationalOperations; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + + private final FileSharesManagementClient clientObject; + + private FilesharesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new FileSharesManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of fileshares service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the fileshares service API instance. + */ + public static FilesharesManager 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 fileshares service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the fileshares service API instance. + */ + public static FilesharesManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new FilesharesManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create FilesharesManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new FilesharesManager.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-fileshares.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 fileshares service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the fileshares service API instance. + */ + public FilesharesManager 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.fileshares") + .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 FilesharesManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of FileShares. It manages FileShare. + * + * @return Resource collection API of FileShares. + */ + public FileShares fileShares() { + if (this.fileShares == null) { + this.fileShares = new FileSharesImpl(clientObject.getFileShares(), this); + } + return fileShares; + } + + /** + * Gets the resource collection API of FileShareSnapshots. It manages FileShareSnapshot. + * + * @return Resource collection API of FileShareSnapshots. + */ + public FileShareSnapshots fileShareSnapshots() { + if (this.fileShareSnapshots == null) { + this.fileShareSnapshots = new FileShareSnapshotsImpl(clientObject.getFileShareSnapshots(), this); + } + return fileShareSnapshots; + } + + /** + * 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 InformationalOperations. + * + * @return Resource collection API of InformationalOperations. + */ + public InformationalOperations informationalOperations() { + if (this.informationalOperations == null) { + this.informationalOperations + = new InformationalOperationsImpl(clientObject.getInformationalOperations(), this); + } + return informationalOperations; + } + + /** + * 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 FileSharesManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + * + * @return Wrapped service client FileSharesManagementClient. + */ + public FileSharesManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/FileShareSnapshotsClient.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/FileShareSnapshotsClient.java new file mode 100644 index 000000000000..a1f3ecae58cd --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/FileShareSnapshotsClient.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.fluent.models.FileShareSnapshotInner; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshotUpdate; + +/** + * An instance of this class provides access to all the operations defined in FileShareSnapshotsClient. + */ +public interface FileShareSnapshotsClient { + /** + * Get a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FileShareSnapshot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getFileShareSnapshotWithResponse(String resourceGroupName, String resourceName, + String name, Context context); + + /** + * Get a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FileShareSnapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareSnapshotInner getFileShareSnapshot(String resourceGroupName, String resourceName, String name); + + /** + * Create a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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, FileShareSnapshotInner> beginCreateOrUpdateFileShareSnapshot( + String resourceGroupName, String resourceName, String name, FileShareSnapshotInner resource); + + /** + * Create a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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, FileShareSnapshotInner> beginCreateOrUpdateFileShareSnapshot( + String resourceGroupName, String resourceName, String name, FileShareSnapshotInner resource, Context context); + + /** + * Create a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareSnapshotInner createOrUpdateFileShareSnapshot(String resourceGroupName, String resourceName, String name, + FileShareSnapshotInner resource); + + /** + * Create a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareSnapshotInner createOrUpdateFileShareSnapshot(String resourceGroupName, String resourceName, String name, + FileShareSnapshotInner resource, Context context); + + /** + * Update a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of fileShareSnapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FileShareSnapshotInner> beginUpdateFileShareSnapshot( + String resourceGroupName, String resourceName, String name, FileShareSnapshotUpdate properties); + + /** + * Update a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of fileShareSnapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FileShareSnapshotInner> beginUpdateFileShareSnapshot( + String resourceGroupName, String resourceName, String name, FileShareSnapshotUpdate properties, + Context context); + + /** + * Update a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fileShareSnapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareSnapshotInner updateFileShareSnapshot(String resourceGroupName, String resourceName, String name, + FileShareSnapshotUpdate properties); + + /** + * Update a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fileShareSnapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareSnapshotInner updateFileShareSnapshot(String resourceGroupName, String resourceName, String name, + FileShareSnapshotUpdate properties, Context context); + + /** + * Delete a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginDeleteFileShareSnapshot(String resourceGroupName, String resourceName, + String name); + + /** + * Delete a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginDeleteFileShareSnapshot(String resourceGroupName, String resourceName, + String name, Context context); + + /** + * Delete a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteFileShareSnapshot(String resourceGroupName, String resourceName, String name); + + /** + * Delete a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteFileShareSnapshot(String resourceGroupName, String resourceName, String name, Context context); + + /** + * List FileShareSnapshot by FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShareSnapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFileShare(String resourceGroupName, String resourceName); + + /** + * List FileShareSnapshot by FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShareSnapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFileShare(String resourceGroupName, String resourceName, + Context context); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/FileSharesClient.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/FileSharesClient.java new file mode 100644 index 000000000000..476618ffa18f --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/FileSharesClient.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.fluent.models.CheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareInner; +import com.azure.resourcemanager.fileshares.models.CheckNameAvailabilityRequest; +import com.azure.resourcemanager.fileshares.models.FileShareUpdate; + +/** + * An instance of this class provides access to all the operations defined in FileSharesClient. + */ +public interface FileSharesClient { + /** + * Get a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FileShare along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context); + + /** + * Get a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FileShare. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareInner getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Create or update a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of file share resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FileShareInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, FileShareInner resource); + + /** + * Create or update a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of file share resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FileShareInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, FileShareInner resource, Context context); + + /** + * Create or update a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareInner createOrUpdate(String resourceGroupName, String resourceName, FileShareInner resource); + + /** + * Create or update a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareInner createOrUpdate(String resourceGroupName, String resourceName, FileShareInner resource, + Context context); + + /** + * Update a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of file share resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FileShareInner> beginUpdate(String resourceGroupName, String resourceName, + FileShareUpdate properties); + + /** + * Update a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of file share resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FileShareInner> beginUpdate(String resourceGroupName, String resourceName, + FileShareUpdate properties, Context context); + + /** + * Update a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareInner update(String resourceGroupName, String resourceName, FileShareUpdate properties); + + /** + * Update a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareInner update(String resourceGroupName, String resourceName, FileShareUpdate properties, Context context); + + /** + * Delete a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 resourceName); + + /** + * Delete a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 resourceName, Context context); + + /** + * Delete a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceName); + + /** + * Delete a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceName, Context context); + + /** + * List FileShare resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShare list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List FileShare resources by subscription 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 response of a FileShare list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List FileShare resources by 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 response of a FileShare list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List FileShare resources by 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 response of a FileShare list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Implements local CheckNameAvailability operations. + * + * @param location The name of the Azure region. + * @param body The CheckAvailability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the check availability result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse(String location, + CheckNameAvailabilityRequest body, Context context); + + /** + * Implements local CheckNameAvailability operations. + * + * @param location The name of the Azure region. + * @param body The CheckAvailability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the check availability result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResponseInner checkNameAvailability(String location, CheckNameAvailabilityRequest body); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/FileSharesManagementClient.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/FileSharesManagementClient.java new file mode 100644 index 000000000000..d01e55785a3d --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/FileSharesManagementClient.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for FileSharesManagementClient class. + */ +public interface FileSharesManagementClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * 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 FileSharesClient object to access its operations. + * + * @return the FileSharesClient object. + */ + FileSharesClient getFileShares(); + + /** + * Gets the FileShareSnapshotsClient object to access its operations. + * + * @return the FileShareSnapshotsClient object. + */ + FileShareSnapshotsClient getFileShareSnapshots(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the InformationalOperationsClient object to access its operations. + * + * @return the InformationalOperationsClient object. + */ + InformationalOperationsClient getInformationalOperations(); + + /** + * 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/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/InformationalOperationsClient.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/InformationalOperationsClient.java new file mode 100644 index 000000000000..03fedf136e27 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/InformationalOperationsClient.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.fluent.models.FileShareLimitsResponseInner; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareProvisioningRecommendationResponseInner; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareUsageDataResponseInner; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationRequest; + +/** + * An instance of this class provides access to all the operations defined in InformationalOperationsClient. + */ +public interface InformationalOperationsClient { + /** + * Get file shares usage data. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares usage data along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getUsageDataWithResponse(String location, Context context); + + /** + * Get file shares usage data. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares usage data. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareUsageDataResponseInner getUsageData(String location); + + /** + * Get file shares limits. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares limits along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLimitsWithResponse(String location, Context context); + + /** + * Get file shares limits. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares limits. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareLimitsResponseInner getLimits(String location); + + /** + * Get file shares provisioning parameters recommendation. + * + * @param location The name of the Azure region. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares provisioning parameters recommendation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getProvisioningRecommendationWithResponse( + String location, FileShareProvisioningRecommendationRequest body, Context context); + + /** + * Get file shares provisioning parameters recommendation. + * + * @param location The name of the Azure region. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares provisioning parameters recommendation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FileShareProvisioningRecommendationResponseInner getProvisioningRecommendation(String location, + FileShareProvisioningRecommendationRequest body); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/OperationsClient.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/OperationsClient.java new file mode 100644 index 000000000000..e9a86083a7fb --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/OperationsClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.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 REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/PrivateEndpointConnectionsClient.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 000000000000..928788b0b7be --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.fluent.models.PrivateEndpointConnectionInner; + +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ +public interface PrivateEndpointConnectionsClient { + /** + * Gets the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 file share along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context); + + /** + * Gets the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 file share. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get(String resourceGroupName, String resourceName, + String privateEndpointConnectionName); + + /** + * Update the state of specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param resource The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner resource); + + /** + * Update the state of specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param resource The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner resource, Context context); + + /** + * Update the state of specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param resource The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner create(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner resource); + + /** + * Update the state of specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param resource The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner create(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner resource, Context context); + + /** + * Deletes the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 resourceName, + String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 resourceName, + String privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 resourceName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 resourceName, String privateEndpointConnectionName, Context context); + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PrivateEndpointConnection List as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFileShare(String resourceGroupName, String resourceName); + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PrivateEndpointConnection List as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByFileShare(String resourceGroupName, String resourceName, + Context context); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/PrivateLinkResourcesClient.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 000000000000..76b5f42f1602 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.fluent.models.PrivateLinkResourceInner; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ +public interface PrivateLinkResourcesClient { + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a file share along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String resourceName, + String privateLinkResourceName, Context context); + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a file share. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String resourceName, String privateLinkResourceName); + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resources that need to be created for a file share as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resources that need to be created for a file share as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/CheckNameAvailabilityResponseInner.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/CheckNameAvailabilityResponseInner.java new file mode 100644 index 000000000000..3486215f0336 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/CheckNameAvailabilityResponseInner.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.models.CheckNameAvailabilityReason; +import java.io.IOException; + +/** + * The check availability result. + */ +@Immutable +public final class CheckNameAvailabilityResponseInner implements JsonSerializable { + /* + * Indicates if the resource name is available. + */ + private Boolean nameAvailable; + + /* + * The reason why the given name is not available. + */ + private CheckNameAvailabilityReason reason; + + /* + * Detailed reason why the given name is not available. + */ + private String message; + + /** + * Creates an instance of CheckNameAvailabilityResponseInner class. + */ + private CheckNameAvailabilityResponseInner() { + } + + /** + * Get the nameAvailable property: Indicates if the resource name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason property: The reason why the given name is not available. + * + * @return the reason value. + */ + public CheckNameAvailabilityReason reason() { + return this.reason; + } + + /** + * Get the message property: Detailed reason why the given name is not available. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("nameAvailable", this.nameAvailable); + jsonWriter.writeStringField("reason", this.reason == null ? null : this.reason.toString()); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityResponseInner 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 CheckNameAvailabilityResponseInner. + */ + public static CheckNameAvailabilityResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityResponseInner deserializedCheckNameAvailabilityResponseInner + = new CheckNameAvailabilityResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedCheckNameAvailabilityResponseInner.nameAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("reason".equals(fieldName)) { + deserializedCheckNameAvailabilityResponseInner.reason + = CheckNameAvailabilityReason.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedCheckNameAvailabilityResponseInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityResponseInner; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareInner.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareInner.java new file mode 100644 index 000000000000..e600c75a658f --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareInner.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.models.FileShareProperties; +import java.io.IOException; +import java.util.Map; + +/** + * File share resource. + */ +@Fluent +public final class FileShareInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private FileShareProperties properties; + + /* + * 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 FileShareInner class. + */ + public FileShareInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public FileShareProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the FileShareInner object itself. + */ + public FileShareInner withProperties(FileShareProperties properties) { + this.properties = properties; + return this; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public FileShareInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FileShareInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@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.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareInner 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 FileShareInner. + */ + public static FileShareInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareInner deserializedFileShareInner = new FileShareInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFileShareInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFileShareInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFileShareInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedFileShareInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFileShareInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedFileShareInner.properties = FileShareProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFileShareInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareInner; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareLimitsResponseInner.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareLimitsResponseInner.java new file mode 100644 index 000000000000..7a08b94a1083 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareLimitsResponseInner.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.models.FileShareLimitsOutput; +import java.io.IOException; + +/** + * Response structure for file share limits API. + */ +@Immutable +public final class FileShareLimitsResponseInner implements JsonSerializable { + /* + * The properties of the file share limits. + */ + private FileShareLimitsOutput properties; + + /** + * Creates an instance of FileShareLimitsResponseInner class. + */ + private FileShareLimitsResponseInner() { + } + + /** + * Get the properties property: The properties of the file share limits. + * + * @return the properties value. + */ + public FileShareLimitsOutput properties() { + return this.properties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareLimitsResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareLimitsResponseInner 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 FileShareLimitsResponseInner. + */ + public static FileShareLimitsResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareLimitsResponseInner deserializedFileShareLimitsResponseInner = new FileShareLimitsResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedFileShareLimitsResponseInner.properties = FileShareLimitsOutput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareLimitsResponseInner; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareProvisioningRecommendationResponseInner.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareProvisioningRecommendationResponseInner.java new file mode 100644 index 000000000000..79b4c428d980 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareProvisioningRecommendationResponseInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.models.FileShareProvisioningRecommendationOutput; +import java.io.IOException; + +/** + * Response structure for file share provisioning parameters recommendation API. + */ +@Immutable +public final class FileShareProvisioningRecommendationResponseInner + implements JsonSerializable { + /* + * The properties of the file share provisioning recommendation output. + */ + private FileShareProvisioningRecommendationOutput properties; + + /** + * Creates an instance of FileShareProvisioningRecommendationResponseInner class. + */ + private FileShareProvisioningRecommendationResponseInner() { + } + + /** + * Get the properties property: The properties of the file share provisioning recommendation output. + * + * @return the properties value. + */ + public FileShareProvisioningRecommendationOutput properties() { + return this.properties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareProvisioningRecommendationResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareProvisioningRecommendationResponseInner 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 FileShareProvisioningRecommendationResponseInner. + */ + public static FileShareProvisioningRecommendationResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareProvisioningRecommendationResponseInner deserializedFileShareProvisioningRecommendationResponseInner + = new FileShareProvisioningRecommendationResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedFileShareProvisioningRecommendationResponseInner.properties + = FileShareProvisioningRecommendationOutput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareProvisioningRecommendationResponseInner; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareSnapshotInner.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareSnapshotInner.java new file mode 100644 index 000000000000..15787903db26 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareSnapshotInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.models.FileShareSnapshotProperties; +import java.io.IOException; + +/** + * FileShareSnapshot resource. + */ +@Fluent +public final class FileShareSnapshotInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private FileShareSnapshotProperties properties; + + /* + * 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 FileShareSnapshotInner class. + */ + public FileShareSnapshotInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public FileShareSnapshotProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the FileShareSnapshotInner object itself. + */ + public FileShareSnapshotInner withProperties(FileShareSnapshotProperties properties) { + this.properties = properties; + return this; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareSnapshotInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareSnapshotInner 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 FileShareSnapshotInner. + */ + public static FileShareSnapshotInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareSnapshotInner deserializedFileShareSnapshotInner = new FileShareSnapshotInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFileShareSnapshotInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFileShareSnapshotInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFileShareSnapshotInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFileShareSnapshotInner.properties = FileShareSnapshotProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFileShareSnapshotInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareSnapshotInner; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareUsageDataResponseInner.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareUsageDataResponseInner.java new file mode 100644 index 000000000000..38c05f3ae8e7 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareUsageDataResponseInner.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.models.FileShareUsageDataOutput; +import java.io.IOException; + +/** + * Response structure for file shares usage in the specified subscription/location. + */ +@Immutable +public final class FileShareUsageDataResponseInner implements JsonSerializable { + /* + * The properties of the file share usage data. + */ + private FileShareUsageDataOutput properties; + + /** + * Creates an instance of FileShareUsageDataResponseInner class. + */ + private FileShareUsageDataResponseInner() { + } + + /** + * Get the properties property: The properties of the file share usage data. + * + * @return the properties value. + */ + public FileShareUsageDataOutput properties() { + return this.properties; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareUsageDataResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareUsageDataResponseInner 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 FileShareUsageDataResponseInner. + */ + public static FileShareUsageDataResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareUsageDataResponseInner deserializedFileShareUsageDataResponseInner + = new FileShareUsageDataResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedFileShareUsageDataResponseInner.properties = FileShareUsageDataOutput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareUsageDataResponseInner; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/OperationInner.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/OperationInner.java new file mode 100644 index 000000000000..f3f883e04c75 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/OperationInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.models.ActionType; +import com.azure.resourcemanager.fileshares.models.OperationDisplay; +import com.azure.resourcemanager.fileshares.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Immutable +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + private OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + 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 ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/PrivateEndpointConnectionInner.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..516742014e41 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.models.PrivateEndpointConnectionProperties; +import java.io.IOException; + +/** + * The private endpoint connection resource. + */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Resource properties. + */ + private PrivateEndpointConnectionProperties properties; + + /* + * 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 properties property: Resource properties. + * + * @return the properties value. + */ + public PrivateEndpointConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Resource properties. + * + * @param properties the properties value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProperties(PrivateEndpointConnectionProperties properties) { + this.properties = properties; + return this; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + 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.properties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/PrivateLinkResourceInner.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..1f30fdb42c10 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.fluent.models; + +import com.azure.core.annotation.Immutable; +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.fileshares.models.PrivateLinkResourceProperties; +import java.io.IOException; + +/** + * A private link resource. + */ +@Immutable +public final class PrivateLinkResourceInner extends ProxyResource { + /* + * Resource properties. + */ + private PrivateLinkResourceProperties properties; + + /* + * 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. + */ + private PrivateLinkResourceInner() { + } + + /** + * Get the properties property: Resource properties. + * + * @return the properties value. + */ + public PrivateLinkResourceProperties properties() { + return this.properties; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + 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.properties = PrivateLinkResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceInner; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/package-info.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/models/package-info.java new file mode 100644 index 000000000000..5242c4414ee1 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/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) TypeSpec Code Generator. + +/** + * Package containing the inner data models for FilesharesManagementClient. + * Azure File Shares Resource Provider API. + */ +package com.azure.resourcemanager.fileshares.fluent.models; diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/package-info.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/fluent/package-info.java new file mode 100644 index 000000000000..1b39ab8232aa --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/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) TypeSpec Code Generator. + +/** + * Package containing the service clients for FilesharesManagementClient. + * Azure File Shares Resource Provider API. + */ +package com.azure.resourcemanager.fileshares.fluent; diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/CheckNameAvailabilityResponseImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/CheckNameAvailabilityResponseImpl.java new file mode 100644 index 000000000000..fb986c238b6a --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/CheckNameAvailabilityResponseImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation; + +import com.azure.resourcemanager.fileshares.fluent.models.CheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.fileshares.models.CheckNameAvailabilityReason; +import com.azure.resourcemanager.fileshares.models.CheckNameAvailabilityResponse; + +public final class CheckNameAvailabilityResponseImpl implements CheckNameAvailabilityResponse { + private CheckNameAvailabilityResponseInner innerObject; + + private final com.azure.resourcemanager.fileshares.FilesharesManager serviceManager; + + CheckNameAvailabilityResponseImpl(CheckNameAvailabilityResponseInner innerObject, + com.azure.resourcemanager.fileshares.FilesharesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public CheckNameAvailabilityReason reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.fileshares.FilesharesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareImpl.java new file mode 100644 index 000000000000..e01f3fc4e8e5 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareInner; +import com.azure.resourcemanager.fileshares.models.FileShare; +import com.azure.resourcemanager.fileshares.models.FileShareProperties; +import com.azure.resourcemanager.fileshares.models.FileShareUpdate; +import com.azure.resourcemanager.fileshares.models.FileShareUpdateProperties; +import java.util.Collections; +import java.util.Map; + +public final class FileShareImpl implements FileShare, FileShare.Definition, FileShare.Update { + private FileShareInner innerObject; + + private final com.azure.resourcemanager.fileshares.FilesharesManager 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 FileShareProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FileShareInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.fileshares.FilesharesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private FileShareUpdate updateProperties; + + public FileShareImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public FileShare create() { + this.innerObject = serviceManager.serviceClient() + .getFileShares() + .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), Context.NONE); + return this; + } + + public FileShare create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileShares() + .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), context); + return this; + } + + FileShareImpl(String name, com.azure.resourcemanager.fileshares.FilesharesManager serviceManager) { + this.innerObject = new FileShareInner(); + this.serviceManager = serviceManager; + this.resourceName = name; + } + + public FileShareImpl update() { + this.updateProperties = new FileShareUpdate(); + return this; + } + + public FileShare apply() { + this.innerObject = serviceManager.serviceClient() + .getFileShares() + .update(resourceGroupName, resourceName, updateProperties, Context.NONE); + return this; + } + + public FileShare apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileShares() + .update(resourceGroupName, resourceName, updateProperties, context); + return this; + } + + FileShareImpl(FileShareInner innerObject, com.azure.resourcemanager.fileshares.FilesharesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "fileShares"); + } + + public FileShare refresh() { + this.innerObject = serviceManager.serviceClient() + .getFileShares() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE) + .getValue(); + return this; + } + + public FileShare refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileShares() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, context) + .getValue(); + return this; + } + + public FileShareImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public FileShareImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public FileShareImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public FileShareImpl withProperties(FileShareProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public FileShareImpl withProperties(FileShareUpdateProperties properties) { + this.updateProperties.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel() == null || this.innerModel().id() == null; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareLimitsResponseImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareLimitsResponseImpl.java new file mode 100644 index 000000000000..c58276fc62a6 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareLimitsResponseImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation; + +import com.azure.resourcemanager.fileshares.fluent.models.FileShareLimitsResponseInner; +import com.azure.resourcemanager.fileshares.models.FileShareLimitsOutput; +import com.azure.resourcemanager.fileshares.models.FileShareLimitsResponse; + +public final class FileShareLimitsResponseImpl implements FileShareLimitsResponse { + private FileShareLimitsResponseInner innerObject; + + private final com.azure.resourcemanager.fileshares.FilesharesManager serviceManager; + + FileShareLimitsResponseImpl(FileShareLimitsResponseInner innerObject, + com.azure.resourcemanager.fileshares.FilesharesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public FileShareLimitsOutput properties() { + return this.innerModel().properties(); + } + + public FileShareLimitsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.fileshares.FilesharesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareProvisioningRecommendationResponseImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareProvisioningRecommendationResponseImpl.java new file mode 100644 index 000000000000..b0915c9f8ec7 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareProvisioningRecommendationResponseImpl.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation; + +import com.azure.resourcemanager.fileshares.fluent.models.FileShareProvisioningRecommendationResponseInner; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationOutput; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationResponse; + +public final class FileShareProvisioningRecommendationResponseImpl + implements FileShareProvisioningRecommendationResponse { + private FileShareProvisioningRecommendationResponseInner innerObject; + + private final com.azure.resourcemanager.fileshares.FilesharesManager serviceManager; + + FileShareProvisioningRecommendationResponseImpl(FileShareProvisioningRecommendationResponseInner innerObject, + com.azure.resourcemanager.fileshares.FilesharesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public FileShareProvisioningRecommendationOutput properties() { + return this.innerModel().properties(); + } + + public FileShareProvisioningRecommendationResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.fileshares.FilesharesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareSnapshotImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareSnapshotImpl.java new file mode 100644 index 000000000000..5b2b3a8781b9 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareSnapshotImpl.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareSnapshotInner; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshot; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshotProperties; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshotUpdate; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshotUpdateProperties; + +public final class FileShareSnapshotImpl + implements FileShareSnapshot, FileShareSnapshot.Definition, FileShareSnapshot.Update { + private FileShareSnapshotInner innerObject; + + private final com.azure.resourcemanager.fileshares.FilesharesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public FileShareSnapshotProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FileShareSnapshotInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.fileshares.FilesharesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private String name; + + private FileShareSnapshotUpdate updateProperties; + + public FileShareSnapshotImpl withExistingFileShare(String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + public FileShareSnapshot create() { + this.innerObject = serviceManager.serviceClient() + .getFileShareSnapshots() + .createOrUpdateFileShareSnapshot(resourceGroupName, resourceName, name, this.innerModel(), Context.NONE); + return this; + } + + public FileShareSnapshot create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileShareSnapshots() + .createOrUpdateFileShareSnapshot(resourceGroupName, resourceName, name, this.innerModel(), context); + return this; + } + + FileShareSnapshotImpl(String name, com.azure.resourcemanager.fileshares.FilesharesManager serviceManager) { + this.innerObject = new FileShareSnapshotInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public FileShareSnapshotImpl update() { + this.updateProperties = new FileShareSnapshotUpdate(); + return this; + } + + public FileShareSnapshot apply() { + this.innerObject = serviceManager.serviceClient() + .getFileShareSnapshots() + .updateFileShareSnapshot(resourceGroupName, resourceName, name, updateProperties, Context.NONE); + return this; + } + + public FileShareSnapshot apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileShareSnapshots() + .updateFileShareSnapshot(resourceGroupName, resourceName, name, updateProperties, context); + return this; + } + + FileShareSnapshotImpl(FileShareSnapshotInner innerObject, + com.azure.resourcemanager.fileshares.FilesharesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "fileShares"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "fileShareSnapshots"); + } + + public FileShareSnapshot refresh() { + this.innerObject = serviceManager.serviceClient() + .getFileShareSnapshots() + .getFileShareSnapshotWithResponse(resourceGroupName, resourceName, name, Context.NONE) + .getValue(); + return this; + } + + public FileShareSnapshot refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFileShareSnapshots() + .getFileShareSnapshotWithResponse(resourceGroupName, resourceName, name, context) + .getValue(); + return this; + } + + public FileShareSnapshotImpl withProperties(FileShareSnapshotProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public FileShareSnapshotImpl withProperties(FileShareSnapshotUpdateProperties properties) { + this.updateProperties.withProperties(properties); + return this; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareSnapshotsClientImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareSnapshotsClientImpl.java new file mode 100644 index 000000000000..863c21e65d00 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareSnapshotsClientImpl.java @@ -0,0 +1,1015 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +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.fileshares.fluent.FileShareSnapshotsClient; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareSnapshotInner; +import com.azure.resourcemanager.fileshares.implementation.models.FileShareSnapshotListResult; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshotUpdate; +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 FileShareSnapshotsClient. + */ +public final class FileShareSnapshotsClientImpl implements FileShareSnapshotsClient { + /** + * The proxy service used to perform REST calls. + */ + private final FileShareSnapshotsService service; + + /** + * The service client containing this operation class. + */ + private final FileSharesManagementClientImpl client; + + /** + * Initializes an instance of FileShareSnapshotsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FileShareSnapshotsClientImpl(FileSharesManagementClientImpl client) { + this.service = RestProxy.create(FileShareSnapshotsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FileSharesManagementClientFileShareSnapshots to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "FileSharesManagementClientFileShareSnapshots") + public interface FileShareSnapshotsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getFileShareSnapshot(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getFileShareSnapshotSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdateFileShareSnapshot(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") FileShareSnapshotInner resource, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateFileShareSnapshotSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") FileShareSnapshotInner resource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateFileShareSnapshot(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FileShareSnapshotUpdate properties, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateFileShareSnapshotSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FileShareSnapshotUpdate properties, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteFileShareSnapshot(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteFileShareSnapshotSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("name") String name, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFileShare(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/fileShareSnapshots") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByFileShareSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFileShareNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByFileShareNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 FileShareSnapshot along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getFileShareSnapshotWithResponseAsync(String resourceGroupName, + String resourceName, String name) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getFileShareSnapshot(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 FileShareSnapshot on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getFileShareSnapshotAsync(String resourceGroupName, String resourceName, + String name) { + return getFileShareSnapshotWithResponseAsync(resourceGroupName, resourceName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 FileShareSnapshot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFileShareSnapshotWithResponse(String resourceGroupName, + String resourceName, String name, Context context) { + final String accept = "application/json"; + return service.getFileShareSnapshotSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, accept, context); + } + + /** + * Get a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 FileShareSnapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareSnapshotInner getFileShareSnapshot(String resourceGroupName, String resourceName, String name) { + return getFileShareSnapshotWithResponse(resourceGroupName, resourceName, name, Context.NONE).getValue(); + } + + /** + * Create a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> createOrUpdateFileShareSnapshotWithResponseAsync(String resourceGroupName, + String resourceName, String name, FileShareSnapshotInner resource) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdateFileShareSnapshot(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, name, + contentType, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateFileShareSnapshotWithResponse(String resourceGroupName, + String resourceName, String name, FileShareSnapshotInner resource) { + final String contentType = "application/json"; + return service.createOrUpdateFileShareSnapshotSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, contentType, resource, + Context.NONE); + } + + /** + * Create a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateFileShareSnapshotWithResponse(String resourceGroupName, + String resourceName, String name, FileShareSnapshotInner resource, Context context) { + final String contentType = "application/json"; + return service.createOrUpdateFileShareSnapshotSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, contentType, resource, context); + } + + /** + * Create a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, FileShareSnapshotInner> + beginCreateOrUpdateFileShareSnapshotAsync(String resourceGroupName, String resourceName, String name, + FileShareSnapshotInner resource) { + Mono>> mono + = createOrUpdateFileShareSnapshotWithResponseAsync(resourceGroupName, resourceName, name, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), FileShareSnapshotInner.class, FileShareSnapshotInner.class, + this.client.getContext()); + } + + /** + * Create a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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, FileShareSnapshotInner> beginCreateOrUpdateFileShareSnapshot( + String resourceGroupName, String resourceName, String name, FileShareSnapshotInner resource) { + Response response + = createOrUpdateFileShareSnapshotWithResponse(resourceGroupName, resourceName, name, resource); + return this.client.getLroResult(response, + FileShareSnapshotInner.class, FileShareSnapshotInner.class, Context.NONE); + } + + /** + * Create a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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, FileShareSnapshotInner> beginCreateOrUpdateFileShareSnapshot( + String resourceGroupName, String resourceName, String name, FileShareSnapshotInner resource, Context context) { + Response response + = createOrUpdateFileShareSnapshotWithResponse(resourceGroupName, resourceName, name, resource, context); + return this.client.getLroResult(response, + FileShareSnapshotInner.class, FileShareSnapshotInner.class, context); + } + + /** + * Create a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateFileShareSnapshotAsync(String resourceGroupName, + String resourceName, String name, FileShareSnapshotInner resource) { + return beginCreateOrUpdateFileShareSnapshotAsync(resourceGroupName, resourceName, name, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareSnapshotInner createOrUpdateFileShareSnapshot(String resourceGroupName, String resourceName, + String name, FileShareSnapshotInner resource) { + return beginCreateOrUpdateFileShareSnapshot(resourceGroupName, resourceName, name, resource).getFinalResult(); + } + + /** + * Create a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareSnapshotInner createOrUpdateFileShareSnapshot(String resourceGroupName, String resourceName, + String name, FileShareSnapshotInner resource, Context context) { + return beginCreateOrUpdateFileShareSnapshot(resourceGroupName, resourceName, name, resource, context) + .getFinalResult(); + } + + /** + * Update a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fileShareSnapshot resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateFileShareSnapshotWithResponseAsync(String resourceGroupName, + String resourceName, String name, FileShareSnapshotUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateFileShareSnapshot(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, name, + contentType, accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fileShareSnapshot resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateFileShareSnapshotWithResponse(String resourceGroupName, String resourceName, + String name, FileShareSnapshotUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateFileShareSnapshotSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, contentType, accept, properties, + Context.NONE); + } + + /** + * Update a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fileShareSnapshot resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateFileShareSnapshotWithResponse(String resourceGroupName, String resourceName, + String name, FileShareSnapshotUpdate properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateFileShareSnapshotSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, contentType, accept, properties, + context); + } + + /** + * Update a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 fileShareSnapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FileShareSnapshotInner> beginUpdateFileShareSnapshotAsync( + String resourceGroupName, String resourceName, String name, FileShareSnapshotUpdate properties) { + Mono>> mono + = updateFileShareSnapshotWithResponseAsync(resourceGroupName, resourceName, name, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), FileShareSnapshotInner.class, FileShareSnapshotInner.class, + this.client.getContext()); + } + + /** + * Update a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of fileShareSnapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FileShareSnapshotInner> beginUpdateFileShareSnapshot( + String resourceGroupName, String resourceName, String name, FileShareSnapshotUpdate properties) { + Response response + = updateFileShareSnapshotWithResponse(resourceGroupName, resourceName, name, properties); + return this.client.getLroResult(response, + FileShareSnapshotInner.class, FileShareSnapshotInner.class, Context.NONE); + } + + /** + * Update a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of fileShareSnapshot resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FileShareSnapshotInner> beginUpdateFileShareSnapshot( + String resourceGroupName, String resourceName, String name, FileShareSnapshotUpdate properties, + Context context) { + Response response + = updateFileShareSnapshotWithResponse(resourceGroupName, resourceName, name, properties, context); + return this.client.getLroResult(response, + FileShareSnapshotInner.class, FileShareSnapshotInner.class, context); + } + + /** + * Update a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fileShareSnapshot resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateFileShareSnapshotAsync(String resourceGroupName, String resourceName, + String name, FileShareSnapshotUpdate properties) { + return beginUpdateFileShareSnapshotAsync(resourceGroupName, resourceName, name, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fileShareSnapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareSnapshotInner updateFileShareSnapshot(String resourceGroupName, String resourceName, String name, + FileShareSnapshotUpdate properties) { + return beginUpdateFileShareSnapshot(resourceGroupName, resourceName, name, properties).getFinalResult(); + } + + /** + * Update a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return fileShareSnapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareSnapshotInner updateFileShareSnapshot(String resourceGroupName, String resourceName, String name, + FileShareSnapshotUpdate properties, Context context) { + return beginUpdateFileShareSnapshot(resourceGroupName, resourceName, name, properties, context) + .getFinalResult(); + } + + /** + * Delete a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> deleteFileShareSnapshotWithResponseAsync(String resourceGroupName, + String resourceName, String name) { + return FluxUtil + .withContext( + context -> service.deleteFileShareSnapshot(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteFileShareSnapshotWithResponse(String resourceGroupName, String resourceName, + String name) { + return service.deleteFileShareSnapshotSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, Context.NONE); + } + + /** + * Delete a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteFileShareSnapshotWithResponse(String resourceGroupName, String resourceName, + String name, Context context) { + return service.deleteFileShareSnapshotSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, name, context); + } + + /** + * Delete a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginDeleteFileShareSnapshotAsync(String resourceGroupName, + String resourceName, String name) { + Mono>> mono + = deleteFileShareSnapshotWithResponseAsync(resourceGroupName, resourceName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginDeleteFileShareSnapshot(String resourceGroupName, + String resourceName, String name) { + Response response = deleteFileShareSnapshotWithResponse(resourceGroupName, resourceName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginDeleteFileShareSnapshot(String resourceGroupName, + String resourceName, String name, Context context) { + Response response + = deleteFileShareSnapshotWithResponse(resourceGroupName, resourceName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteFileShareSnapshotAsync(String resourceGroupName, String resourceName, String name) { + return beginDeleteFileShareSnapshotAsync(resourceGroupName, resourceName, name).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteFileShareSnapshot(String resourceGroupName, String resourceName, String name) { + beginDeleteFileShareSnapshot(resourceGroupName, resourceName, name).getFinalResult(); + } + + /** + * Delete a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteFileShareSnapshot(String resourceGroupName, String resourceName, String name, Context context) { + beginDeleteFileShareSnapshot(resourceGroupName, resourceName, name, context).getFinalResult(); + } + + /** + * List FileShareSnapshot by FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShareSnapshot list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFileShareSinglePageAsync(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByFileShare(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, 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 FileShareSnapshot by FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShareSnapshot list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByFileShareAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>(() -> listByFileShareSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listByFileShareNextSinglePageAsync(nextLink)); + } + + /** + * List FileShareSnapshot by FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShareSnapshot list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByFileShareSinglePage(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + Response res + = service.listByFileShareSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List FileShareSnapshot by FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShareSnapshot list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByFileShareSinglePage(String resourceGroupName, + String resourceName, Context context) { + final String accept = "application/json"; + Response res + = service.listByFileShareSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List FileShareSnapshot by FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShareSnapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFileShare(String resourceGroupName, String resourceName) { + return new PagedIterable<>(() -> listByFileShareSinglePage(resourceGroupName, resourceName), + nextLink -> listByFileShareNextSinglePage(nextLink)); + } + + /** + * List FileShareSnapshot by FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShareSnapshot list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFileShare(String resourceGroupName, String resourceName, + Context context) { + return new PagedIterable<>(() -> listByFileShareSinglePage(resourceGroupName, resourceName, context), + nextLink -> listByFileShareNextSinglePage(nextLink, 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 the response of a FileShareSnapshot list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFileShareNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByFileShareNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShareSnapshot list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByFileShareNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByFileShareNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShareSnapshot list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByFileShareNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByFileShareNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareSnapshotsImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareSnapshotsImpl.java new file mode 100644 index 000000000000..857e628ce0a5 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareSnapshotsImpl.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.fluent.FileShareSnapshotsClient; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareSnapshotInner; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshot; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshots; + +public final class FileShareSnapshotsImpl implements FileShareSnapshots { + private static final ClientLogger LOGGER = new ClientLogger(FileShareSnapshotsImpl.class); + + private final FileShareSnapshotsClient innerClient; + + private final com.azure.resourcemanager.fileshares.FilesharesManager serviceManager; + + public FileShareSnapshotsImpl(FileShareSnapshotsClient innerClient, + com.azure.resourcemanager.fileshares.FilesharesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getFileShareSnapshotWithResponse(String resourceGroupName, String resourceName, + String name, Context context) { + Response inner + = this.serviceClient().getFileShareSnapshotWithResponse(resourceGroupName, resourceName, name, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileShareSnapshotImpl(inner.getValue(), this.manager())); + } + + public FileShareSnapshot getFileShareSnapshot(String resourceGroupName, String resourceName, String name) { + FileShareSnapshotInner inner = this.serviceClient().getFileShareSnapshot(resourceGroupName, resourceName, name); + if (inner != null) { + return new FileShareSnapshotImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteFileShareSnapshot(String resourceGroupName, String resourceName, String name) { + this.serviceClient().deleteFileShareSnapshot(resourceGroupName, resourceName, name); + } + + public void deleteFileShareSnapshot(String resourceGroupName, String resourceName, String name, Context context) { + this.serviceClient().deleteFileShareSnapshot(resourceGroupName, resourceName, name, context); + } + + public PagedIterable listByFileShare(String resourceGroupName, String resourceName) { + PagedIterable inner + = this.serviceClient().listByFileShare(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileShareSnapshotImpl(inner1, this.manager())); + } + + public PagedIterable listByFileShare(String resourceGroupName, String resourceName, + Context context) { + PagedIterable inner + = this.serviceClient().listByFileShare(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileShareSnapshotImpl(inner1, this.manager())); + } + + public FileShareSnapshot getFileShareSnapshotById(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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "fileShares"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShares'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "fileShareSnapshots"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShareSnapshots'.", id))); + } + return this.getFileShareSnapshotWithResponse(resourceGroupName, resourceName, name, Context.NONE).getValue(); + } + + public Response getFileShareSnapshotByIdWithResponse(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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "fileShares"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShares'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "fileShareSnapshots"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShareSnapshots'.", id))); + } + return this.getFileShareSnapshotWithResponse(resourceGroupName, resourceName, name, context); + } + + public void deleteFileShareSnapshotById(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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "fileShares"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShares'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "fileShareSnapshots"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShareSnapshots'.", id))); + } + this.deleteFileShareSnapshot(resourceGroupName, resourceName, name, Context.NONE); + } + + public void deleteFileShareSnapshotByIdWithResponse(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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "fileShares"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShares'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "fileShareSnapshots"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShareSnapshots'.", id))); + } + this.deleteFileShareSnapshot(resourceGroupName, resourceName, name, context); + } + + private FileShareSnapshotsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.fileshares.FilesharesManager manager() { + return this.serviceManager; + } + + public FileShareSnapshotImpl define(String name) { + return new FileShareSnapshotImpl(name, this.manager()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareUsageDataResponseImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareUsageDataResponseImpl.java new file mode 100644 index 000000000000..ad2743fb51e6 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareUsageDataResponseImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation; + +import com.azure.resourcemanager.fileshares.fluent.models.FileShareUsageDataResponseInner; +import com.azure.resourcemanager.fileshares.models.FileShareUsageDataOutput; +import com.azure.resourcemanager.fileshares.models.FileShareUsageDataResponse; + +public final class FileShareUsageDataResponseImpl implements FileShareUsageDataResponse { + private FileShareUsageDataResponseInner innerObject; + + private final com.azure.resourcemanager.fileshares.FilesharesManager serviceManager; + + FileShareUsageDataResponseImpl(FileShareUsageDataResponseInner innerObject, + com.azure.resourcemanager.fileshares.FilesharesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public FileShareUsageDataOutput properties() { + return this.innerModel().properties(); + } + + public FileShareUsageDataResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.fileshares.FilesharesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesClientImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesClientImpl.java new file mode 100644 index 000000000000..26b72473badc --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesClientImpl.java @@ -0,0 +1,1217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +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.fileshares.fluent.FileSharesClient; +import com.azure.resourcemanager.fileshares.fluent.models.CheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareInner; +import com.azure.resourcemanager.fileshares.implementation.models.FileShareListResult; +import com.azure.resourcemanager.fileshares.models.CheckNameAvailabilityRequest; +import com.azure.resourcemanager.fileshares.models.FileShareUpdate; +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 FileSharesClient. + */ +public final class FileSharesClientImpl implements FileSharesClient { + /** + * The proxy service used to perform REST calls. + */ + private final FileSharesService service; + + /** + * The service client containing this operation class. + */ + private final FileSharesManagementClientImpl client; + + /** + * Initializes an instance of FileSharesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FileSharesClientImpl(FileSharesManagementClientImpl client) { + this.service + = RestProxy.create(FileSharesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FileSharesManagementClientFileShares to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "FileSharesManagementClientFileShares") + public interface FileSharesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FileShareInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FileShareInner resource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FileShareUpdate properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FileShareUpdate properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.FileShares/fileShares") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.FileShares/fileShares") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.FileShares/locations/{location}/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CheckNameAvailabilityRequest body, + Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.FileShares/locations/{location}/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkNameAvailabilitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CheckNameAvailabilityRequest body, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByParentNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByParentNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 FileShare along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 FileShare on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 FileShare along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + } + + /** + * Get a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 FileShare. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } + + /** + * Create or update a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String resourceName, FileShareInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, resource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + FileShareInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, resource, + Context.NONE); + } + + /** + * Create or update a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, + FileShareInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, resource, context); + } + + /** + * Create or update a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 file share resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FileShareInner> beginCreateOrUpdateAsync(String resourceGroupName, + String resourceName, FileShareInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + FileShareInner.class, FileShareInner.class, this.client.getContext()); + } + + /** + * Create or update a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of file share resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FileShareInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, FileShareInner resource) { + Response response = createOrUpdateWithResponse(resourceGroupName, resourceName, resource); + return this.client.getLroResult(response, FileShareInner.class, + FileShareInner.class, Context.NONE); + } + + /** + * Create or update a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of file share resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FileShareInner> beginCreateOrUpdate(String resourceGroupName, + String resourceName, FileShareInner resource, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, resourceName, resource, context); + return this.client.getLroResult(response, FileShareInner.class, + FileShareInner.class, context); + } + + /** + * Create or update a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, + FileShareInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareInner createOrUpdate(String resourceGroupName, String resourceName, FileShareInner resource) { + return beginCreateOrUpdate(resourceGroupName, resourceName, resource).getFinalResult(); + } + + /** + * Create or update a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareInner createOrUpdate(String resourceGroupName, String resourceName, FileShareInner resource, + Context context) { + return beginCreateOrUpdate(resourceGroupName, resourceName, resource, context).getFinalResult(); + } + + /** + * Update a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String resourceName, + FileShareUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String resourceName, + FileShareUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, properties, + Context.NONE); + } + + /** + * Update a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String resourceName, + FileShareUpdate properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, properties, context); + } + + /** + * Update a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 file share resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FileShareInner> beginUpdateAsync(String resourceGroupName, + String resourceName, FileShareUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + FileShareInner.class, FileShareInner.class, this.client.getContext()); + } + + /** + * Update a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of file share resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FileShareInner> beginUpdate(String resourceGroupName, + String resourceName, FileShareUpdate properties) { + Response response = updateWithResponse(resourceGroupName, resourceName, properties); + return this.client.getLroResult(response, FileShareInner.class, + FileShareInner.class, Context.NONE); + } + + /** + * Update a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of file share resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FileShareInner> beginUpdate(String resourceGroupName, + String resourceName, FileShareUpdate properties, Context context) { + Response response = updateWithResponse(resourceGroupName, resourceName, properties, context); + return this.client.getLroResult(response, FileShareInner.class, + FileShareInner.class, context); + } + + /** + * Update a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String resourceName, + FileShareUpdate properties) { + return beginUpdateAsync(resourceGroupName, resourceName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareInner update(String resourceGroupName, String resourceName, FileShareUpdate properties) { + return beginUpdate(resourceGroupName, resourceName, properties).getFinalResult(); + } + + /** + * Update a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file share resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareInner update(String resourceGroupName, String resourceName, FileShareUpdate properties, + Context context) { + return beginUpdate(resourceGroupName, resourceName, properties, context).getFinalResult(); + } + + /** + * Delete a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 resourceName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, Context.NONE); + } + + /** + * Delete a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, context); + } + + /** + * Delete a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 resourceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 resourceName) { + Response response = deleteWithResponse(resourceGroupName, resourceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 resourceName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, resourceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceName) { + return beginDeleteAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceName) { + beginDelete(resourceGroupName, resourceName).getFinalResult(); + } + + /** + * Delete a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceName, Context context) { + beginDelete(resourceGroupName, resourceName, context).getFinalResult(); + } + + /** + * List FileShare resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShare list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List FileShare resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShare list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List FileShare resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShare list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List FileShare resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShare list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List FileShare resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShare list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List FileShare resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShare list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * List FileShare resources by 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 response of a FileShare list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List FileShare resources by 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 response of a FileShare list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByParentNextSinglePageAsync(nextLink)); + } + + /** + * List FileShare resources by 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 response of a FileShare list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List FileShare resources by 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 response of a FileShare list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List FileShare resources by 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 response of a FileShare list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByParentNextSinglePage(nextLink)); + } + + /** + * List FileShare resources by 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 response of a FileShare list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByParentNextSinglePage(nextLink, context)); + } + + /** + * Implements local CheckNameAvailability operations. + * + * @param location The name of the Azure region. + * @param body The CheckAvailability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the check availability result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync(String location, + CheckNameAvailabilityRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Implements local CheckNameAvailability operations. + * + * @param location The name of the Azure region. + * @param body The CheckAvailability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the check availability result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync(String location, + CheckNameAvailabilityRequest body) { + return checkNameAvailabilityWithResponseAsync(location, body).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Implements local CheckNameAvailability operations. + * + * @param location The name of the Azure region. + * @param body The CheckAvailability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the check availability result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse(String location, + CheckNameAvailabilityRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, body, context); + } + + /** + * Implements local CheckNameAvailability operations. + * + * @param location The name of the Azure region. + * @param body The CheckAvailability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the check availability result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResponseInner checkNameAvailability(String location, + CheckNameAvailabilityRequest body) { + return checkNameAvailabilityWithResponse(location, body, 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 the response of a FileShare list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShare list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShare list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 response of a FileShare list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByParentNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByParentNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShare list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByParentNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByParentNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShare list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByParentNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByParentNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesImpl.java new file mode 100644 index 000000000000..f74da397185d --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.fluent.FileSharesClient; +import com.azure.resourcemanager.fileshares.fluent.models.CheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareInner; +import com.azure.resourcemanager.fileshares.models.CheckNameAvailabilityRequest; +import com.azure.resourcemanager.fileshares.models.CheckNameAvailabilityResponse; +import com.azure.resourcemanager.fileshares.models.FileShare; +import com.azure.resourcemanager.fileshares.models.FileShares; + +public final class FileSharesImpl implements FileShares { + private static final ClientLogger LOGGER = new ClientLogger(FileSharesImpl.class); + + private final FileSharesClient innerClient; + + private final com.azure.resourcemanager.fileshares.FilesharesManager serviceManager; + + public FileSharesImpl(FileSharesClient innerClient, + com.azure.resourcemanager.fileshares.FilesharesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileShareImpl(inner.getValue(), this.manager())); + } + + public FileShare getByResourceGroup(String resourceGroupName, String resourceName) { + FileShareInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); + if (inner != null) { + return new FileShareImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String resourceName) { + this.serviceClient().delete(resourceGroupName, resourceName); + } + + public void delete(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileShareImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileShareImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileShareImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileShareImpl(inner1, this.manager())); + } + + public Response checkNameAvailabilityWithResponse(String location, + CheckNameAvailabilityRequest body, Context context) { + Response inner + = this.serviceClient().checkNameAvailabilityWithResponse(location, body, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); + } + + public CheckNameAvailabilityResponse checkNameAvailability(String location, CheckNameAvailabilityRequest body) { + CheckNameAvailabilityResponseInner inner = this.serviceClient().checkNameAvailability(location, body); + if (inner != null) { + return new CheckNameAvailabilityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public FileShare 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "fileShares"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShares'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "fileShares"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShares'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "fileShares"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShares'.", id))); + } + this.delete(resourceGroupName, resourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "fileShares"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShares'.", id))); + } + this.delete(resourceGroupName, resourceName, context); + } + + private FileSharesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.fileshares.FilesharesManager manager() { + return this.serviceManager; + } + + public FileShareImpl define(String name) { + return new FileShareImpl(name, this.manager()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesManagementClientBuilder.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesManagementClientBuilder.java new file mode 100644 index 000000000000..731fc2623d31 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesManagementClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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 FileSharesManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { FileSharesManagementClientImpl.class }) +public final class FileSharesManagementClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the FileSharesManagementClientBuilder. + */ + public FileSharesManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the FileSharesManagementClientBuilder. + */ + public FileSharesManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the FileSharesManagementClientBuilder. + */ + public FileSharesManagementClientBuilder 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 FileSharesManagementClientBuilder. + */ + public FileSharesManagementClientBuilder 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 FileSharesManagementClientBuilder. + */ + public FileSharesManagementClientBuilder 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 FileSharesManagementClientBuilder. + */ + public FileSharesManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of FileSharesManagementClientImpl with the provided parameters. + * + * @return an instance of FileSharesManagementClientImpl. + */ + public FileSharesManagementClientImpl 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(); + FileSharesManagementClientImpl client = new FileSharesManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesManagementClientImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesManagementClientImpl.java new file mode 100644 index 000000000000..7122eb7a67b3 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesManagementClientImpl.java @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; +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.polling.SyncPoller; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.fileshares.fluent.FileShareSnapshotsClient; +import com.azure.resourcemanager.fileshares.fluent.FileSharesClient; +import com.azure.resourcemanager.fileshares.fluent.FileSharesManagementClient; +import com.azure.resourcemanager.fileshares.fluent.InformationalOperationsClient; +import com.azure.resourcemanager.fileshares.fluent.OperationsClient; +import com.azure.resourcemanager.fileshares.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.fileshares.fluent.PrivateLinkResourcesClient; +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 FileSharesManagementClientImpl type. + */ +@ServiceClient(builder = FileSharesManagementClientBuilder.class) +public final class FileSharesManagementClientImpl implements FileSharesManagementClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Version parameter. + */ + private final String apiVersion; + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * 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 FileSharesClient object to access its operations. + */ + private final FileSharesClient fileShares; + + /** + * Gets the FileSharesClient object to access its operations. + * + * @return the FileSharesClient object. + */ + public FileSharesClient getFileShares() { + return this.fileShares; + } + + /** + * The FileShareSnapshotsClient object to access its operations. + */ + private final FileShareSnapshotsClient fileShareSnapshots; + + /** + * Gets the FileShareSnapshotsClient object to access its operations. + * + * @return the FileShareSnapshotsClient object. + */ + public FileShareSnapshotsClient getFileShareSnapshots() { + return this.fileShareSnapshots; + } + + /** + * 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 InformationalOperationsClient object to access its operations. + */ + private final InformationalOperationsClient informationalOperations; + + /** + * Gets the InformationalOperationsClient object to access its operations. + * + * @return the InformationalOperationsClient object. + */ + public InformationalOperationsClient getInformationalOperations() { + return this.informationalOperations; + } + + /** + * 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 FileSharesManagementClient 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 endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + */ + FileSharesManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-06-01"; + this.fileShares = new FileSharesClientImpl(this); + this.fileShareSnapshots = new FileShareSnapshotsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.informationalOperations = new InformationalOperationsClientImpl(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 long running operation result. + * + * @param activationResponse the response of activation operation. + * @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 SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.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(FileSharesManagementClientImpl.class); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/InformationalOperationsClientImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/InformationalOperationsClientImpl.java new file mode 100644 index 000000000000..4edac236f7bd --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/InformationalOperationsClientImpl.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.fluent.InformationalOperationsClient; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareLimitsResponseInner; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareProvisioningRecommendationResponseInner; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareUsageDataResponseInner; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in InformationalOperationsClient. + */ +public final class InformationalOperationsClientImpl implements InformationalOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final InformationalOperationsService service; + + /** + * The service client containing this operation class. + */ + private final FileSharesManagementClientImpl client; + + /** + * Initializes an instance of InformationalOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + InformationalOperationsClientImpl(FileSharesManagementClientImpl client) { + this.service = RestProxy.create(InformationalOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FileSharesManagementClientInformationalOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "FileSharesManagementClientInformationalOperations") + public interface InformationalOperationsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.FileShares/locations/{location}/getUsageData") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getUsageData(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.FileShares/locations/{location}/getUsageData") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getUsageDataSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.FileShares/locations/{location}/getLimits") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLimits(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.FileShares/locations/{location}/getLimits") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getLimitsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.FileShares/locations/{location}/getProvisioningRecommendation") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getProvisioningRecommendation( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FileShareProvisioningRecommendationRequest body, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.FileShares/locations/{location}/getProvisioningRecommendation") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getProvisioningRecommendationSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FileShareProvisioningRecommendationRequest body, Context context); + } + + /** + * Get file shares usage data. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares usage data along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getUsageDataWithResponseAsync(String location) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getUsageData(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get file shares usage data. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares usage data on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getUsageDataAsync(String location) { + return getUsageDataWithResponseAsync(location).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get file shares usage data. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares usage data along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUsageDataWithResponse(String location, Context context) { + final String accept = "application/json"; + return service.getUsageDataSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context); + } + + /** + * Get file shares usage data. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares usage data. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareUsageDataResponseInner getUsageData(String location) { + return getUsageDataWithResponse(location, Context.NONE).getValue(); + } + + /** + * Get file shares limits. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares limits along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLimitsWithResponseAsync(String location) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getLimits(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get file shares limits. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares limits on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLimitsAsync(String location) { + return getLimitsWithResponseAsync(location).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get file shares limits. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares limits along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLimitsWithResponse(String location, Context context) { + final String accept = "application/json"; + return service.getLimitsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context); + } + + /** + * Get file shares limits. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares limits. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareLimitsResponseInner getLimits(String location) { + return getLimitsWithResponse(location, Context.NONE).getValue(); + } + + /** + * Get file shares provisioning parameters recommendation. + * + * @param location The name of the Azure region. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares provisioning parameters recommendation along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getProvisioningRecommendationWithResponseAsync(String location, + FileShareProvisioningRecommendationRequest body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getProvisioningRecommendation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get file shares provisioning parameters recommendation. + * + * @param location The name of the Azure region. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares provisioning parameters recommendation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getProvisioningRecommendationAsync(String location, + FileShareProvisioningRecommendationRequest body) { + return getProvisioningRecommendationWithResponseAsync(location, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get file shares provisioning parameters recommendation. + * + * @param location The name of the Azure region. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares provisioning parameters recommendation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getProvisioningRecommendationWithResponse( + String location, FileShareProvisioningRecommendationRequest body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.getProvisioningRecommendationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, body, context); + } + + /** + * Get file shares provisioning parameters recommendation. + * + * @param location The name of the Azure region. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares provisioning parameters recommendation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FileShareProvisioningRecommendationResponseInner getProvisioningRecommendation(String location, + FileShareProvisioningRecommendationRequest body) { + return getProvisioningRecommendationWithResponse(location, body, Context.NONE).getValue(); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/InformationalOperationsImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/InformationalOperationsImpl.java new file mode 100644 index 000000000000..95bbd1636391 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/InformationalOperationsImpl.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.fluent.InformationalOperationsClient; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareLimitsResponseInner; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareProvisioningRecommendationResponseInner; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareUsageDataResponseInner; +import com.azure.resourcemanager.fileshares.models.FileShareLimitsResponse; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationRequest; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationResponse; +import com.azure.resourcemanager.fileshares.models.FileShareUsageDataResponse; +import com.azure.resourcemanager.fileshares.models.InformationalOperations; + +public final class InformationalOperationsImpl implements InformationalOperations { + private static final ClientLogger LOGGER = new ClientLogger(InformationalOperationsImpl.class); + + private final InformationalOperationsClient innerClient; + + private final com.azure.resourcemanager.fileshares.FilesharesManager serviceManager; + + public InformationalOperationsImpl(InformationalOperationsClient innerClient, + com.azure.resourcemanager.fileshares.FilesharesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getUsageDataWithResponse(String location, Context context) { + Response inner + = this.serviceClient().getUsageDataWithResponse(location, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileShareUsageDataResponseImpl(inner.getValue(), this.manager())); + } + + public FileShareUsageDataResponse getUsageData(String location) { + FileShareUsageDataResponseInner inner = this.serviceClient().getUsageData(location); + if (inner != null) { + return new FileShareUsageDataResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getLimitsWithResponse(String location, Context context) { + Response inner = this.serviceClient().getLimitsWithResponse(location, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileShareLimitsResponseImpl(inner.getValue(), this.manager())); + } + + public FileShareLimitsResponse getLimits(String location) { + FileShareLimitsResponseInner inner = this.serviceClient().getLimits(location); + if (inner != null) { + return new FileShareLimitsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getProvisioningRecommendationWithResponse( + String location, FileShareProvisioningRecommendationRequest body, Context context) { + Response inner + = this.serviceClient().getProvisioningRecommendationWithResponse(location, body, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileShareProvisioningRecommendationResponseImpl(inner.getValue(), this.manager())); + } + + public FileShareProvisioningRecommendationResponse getProvisioningRecommendation(String location, + FileShareProvisioningRecommendationRequest body) { + FileShareProvisioningRecommendationResponseInner inner + = this.serviceClient().getProvisioningRecommendation(location, body); + if (inner != null) { + return new FileShareProvisioningRecommendationResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private InformationalOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.fileshares.FilesharesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/OperationImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/OperationImpl.java new file mode 100644 index 000000000000..c9f4e3f9ecef --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/OperationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation; + +import com.azure.resourcemanager.fileshares.fluent.models.OperationInner; +import com.azure.resourcemanager.fileshares.models.ActionType; +import com.azure.resourcemanager.fileshares.models.Operation; +import com.azure.resourcemanager.fileshares.models.OperationDisplay; +import com.azure.resourcemanager.fileshares.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.fileshares.FilesharesManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.fileshares.FilesharesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.fileshares.FilesharesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/OperationsClientImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..449641921359 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/OperationsClientImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.fluent.OperationsClient; +import com.azure.resourcemanager.fileshares.fluent.models.OperationInner; +import com.azure.resourcemanager.fileshares.implementation.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 FileSharesManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(FileSharesManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FileSharesManagementClientOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "FileSharesManagementClientOperations") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.FileShares/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.FileShares/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the provider. + * + * @throws 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 REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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())); + } + + /** + * List the operations for the provider. + * + * @throws 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 REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for the provider. + * + * @throws 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 REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @throws 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 REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/OperationsImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/OperationsImpl.java new file mode 100644 index 000000000000..f7fbfadb5d0c --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.fluent.OperationsClient; +import com.azure.resourcemanager.fileshares.fluent.models.OperationInner; +import com.azure.resourcemanager.fileshares.models.Operation; +import com.azure.resourcemanager.fileshares.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.fileshares.FilesharesManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.fileshares.FilesharesManager 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.fileshares.FilesharesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateEndpointConnectionImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..65f20b1f622d --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.fileshares.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointConnection; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointConnectionProperties; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.fileshares.FilesharesManager serviceManager; + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.fileshares.FilesharesManager 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 PrivateEndpointConnectionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.fileshares.FilesharesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingFileShare(String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .create(resourceGroupName, resourceName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .create(resourceGroupName, resourceName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl(String name, com.azure.resourcemanager.fileshares.FilesharesManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnection refresh() { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withProperties(PrivateEndpointConnectionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 000000000000..b596b48baf84 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,832 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.BinaryData; +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.fileshares.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.fileshares.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.fileshares.implementation.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 FileSharesManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(FileSharesManagementClientImpl client) { + this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FileSharesManagementClientPrivateEndpointConnections to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "FileSharesManagementClientPrivateEndpointConnections") + public interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner resource, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFileShare(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByFileShareSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByFileShareNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByFileShareNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 file share along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String resourceName, String privateEndpointConnectionName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 file share on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 file share along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, privateEndpointConnectionName, accept, context); + } + + /** + * Gets the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 file share. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, Context.NONE).getValue(); + } + + /** + * Update the state of specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param resource The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, + contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the state of specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param resource The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, + contentType, accept, resource, Context.NONE); + } + + /** + * Update the state of specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param resource The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, + contentType, accept, resource, context); + } + + /** + * Update the state of specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param resource The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> beginCreateAsync( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, resource); + 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 file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param resource The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner resource) { + Response response + = createWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, resource); + return this.client.getLroResult(response, + PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, Context.NONE); + } + + /** + * Update the state of specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param resource The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, + PrivateEndpointConnectionInner resource, Context context) { + Response response + = createWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, resource, context); + return this.client.getLroResult(response, + PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, context); + } + + /** + * Update the state of specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param resource The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner resource) { + return beginCreateAsync(resourceGroupName, resourceName, privateEndpointConnectionName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param resource The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner create(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner resource) { + return beginCreate(resourceGroupName, resourceName, privateEndpointConnectionName, resource).getFinalResult(); + } + + /** + * Update the state of specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param resource The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner create(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner resource, Context context) { + return beginCreate(resourceGroupName, resourceName, privateEndpointConnectionName, resource, context) + .getFinalResult(); + } + + /** + * Deletes the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 resourceName, + String privateEndpointConnectionName) { + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, + Context.NONE); + } + + /** + * Deletes the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, context); + } + + /** + * Deletes the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 resourceName, + String privateEndpointConnectionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, resourceName, 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 file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 resourceName, + String privateEndpointConnectionName) { + Response response + = deleteWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 resourceName, + String privateEndpointConnectionName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 resourceName, + String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 resourceName, String privateEndpointConnectionName) { + beginDelete(resourceGroupName, resourceName, privateEndpointConnectionName).getFinalResult(); + } + + /** + * Deletes the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 resourceName, String privateEndpointConnectionName, + Context context) { + beginDelete(resourceGroupName, resourceName, privateEndpointConnectionName, context).getFinalResult(); + } + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PrivateEndpointConnection List along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFileShareSinglePageAsync(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByFileShare(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, 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 a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PrivateEndpointConnection List as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByFileShareAsync(String resourceGroupName, + String resourceName) { + return new PagedFlux<>(() -> listByFileShareSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listByFileShareNextSinglePageAsync(nextLink)); + } + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PrivateEndpointConnection List along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByFileShareSinglePage(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + Response res + = service.listByFileShareSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PrivateEndpointConnection List along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByFileShareSinglePage(String resourceGroupName, + String resourceName, Context context) { + final String accept = "application/json"; + Response res + = service.listByFileShareSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PrivateEndpointConnection List as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFileShare(String resourceGroupName, + String resourceName) { + return new PagedIterable<>(() -> listByFileShareSinglePage(resourceGroupName, resourceName), + nextLink -> listByFileShareNextSinglePage(nextLink)); + } + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PrivateEndpointConnection List as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByFileShare(String resourceGroupName, String resourceName, + Context context) { + return new PagedIterable<>(() -> listByFileShareSinglePage(resourceGroupName, resourceName, context), + nextLink -> listByFileShareNextSinglePage(nextLink, 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 a PrivateEndpointConnection List along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByFileShareNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByFileShareNext(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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PrivateEndpointConnection List along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByFileShareNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByFileShareNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 PrivateEndpointConnection List along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByFileShareNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listByFileShareNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateEndpointConnectionsImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..9256f1ad3a70 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.fileshares.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointConnection; +import com.azure.resourcemanager.fileshares.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.fileshares.FilesharesManager serviceManager; + + public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.fileshares.FilesharesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } + + public PrivateEndpointConnection get(String resourceGroupName, String resourceName, + String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner + = this.serviceClient().get(resourceGroupName, resourceName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, resourceName, privateEndpointConnectionName); + } + + public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName, + Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, privateEndpointConnectionName, context); + } + + public PagedIterable listByFileShare(String resourceGroupName, String resourceName) { + PagedIterable inner + = this.serviceClient().listByFileShare(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByFileShare(String resourceGroupName, String resourceName, + Context context) { + PagedIterable inner + = this.serviceClient().listByFileShare(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "fileShares"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShares'.", 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, resourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "fileShares"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShares'.", 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, resourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "fileShares"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShares'.", 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, resourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "fileShares"); + if (resourceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'fileShares'.", 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, resourceName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.fileshares.FilesharesManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateLinkResourceImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..8d64bcf3aa3e --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.fileshares.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.fileshares.models.PrivateLinkResource; +import com.azure.resourcemanager.fileshares.models.PrivateLinkResourceProperties; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.fileshares.FilesharesManager serviceManager; + + PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.fileshares.FilesharesManager 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 PrivateLinkResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.fileshares.FilesharesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateLinkResourcesClientImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 000000000000..37db1c9554a6 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.fileshares.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.fileshares.implementation.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 FileSharesManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(FileSharesManagementClientImpl client) { + this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for FileSharesManagementClientPrivateLinkResources to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "FileSharesManagementClientPrivateLinkResources") + public interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/privateLinkResources/{privateLinkResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateLinkResourceName") String privateLinkResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/privateLinkResources/{privateLinkResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @PathParam("privateLinkResourceName") String privateLinkResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.FileShares/fileShares/{resourceName}/privateLinkResources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a file share along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, + String privateLinkResourceName) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, privateLinkResourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a file share on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String resourceName, + String privateLinkResourceName) { + return getWithResponseAsync(resourceGroupName, resourceName, privateLinkResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a file share along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String resourceName, + String privateLinkResourceName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, privateLinkResourceName, accept, context); + } + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a file share. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String resourceName, String privateLinkResourceName) { + return getWithResponse(resourceGroupName, resourceName, privateLinkResourceName, Context.NONE).getValue(); + } + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resources that need to be created for a file share along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String resourceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resources that need to be created for a file share as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resources that need to be created for a file share along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resources that need to be created for a file share along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String resourceName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, resourceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resources that need to be created for a file share as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resources that need to be created for a file share as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, resourceName, context), + nextLink -> listNextSinglePage(nextLink, 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 the private link resources that need to be created for a file share along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resources that need to be created for a file share along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 resources that need to be created for a file share along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateLinkResourcesImpl.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 000000000000..de51a4bf2e84 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.fileshares.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.fileshares.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.fileshares.models.PrivateLinkResource; +import com.azure.resourcemanager.fileshares.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.fileshares.FilesharesManager serviceManager; + + public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.fileshares.FilesharesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String resourceName, + String privateLinkResourceName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, resourceName, privateLinkResourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } + + public PrivateLinkResource get(String resourceGroupName, String resourceName, String privateLinkResourceName) { + PrivateLinkResourceInner inner + = this.serviceClient().get(resourceGroupName, resourceName, privateLinkResourceName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String resourceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, resourceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.fileshares.FilesharesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/ResourceManagerUtils.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..41eae78b6f79 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/models/FileShareListResult.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/models/FileShareListResult.java new file mode 100644 index 000000000000..1dde7ad048e2 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/models/FileShareListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation.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.fileshares.fluent.models.FileShareInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a FileShare list operation. + */ +@Immutable +public final class FileShareListResult implements JsonSerializable { + /* + * The FileShare items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of FileShareListResult class. + */ + private FileShareListResult() { + } + + /** + * Get the value property: The FileShare items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareListResult 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 FileShareListResult. + */ + public static FileShareListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareListResult deserializedFileShareListResult = new FileShareListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> FileShareInner.fromJson(reader1)); + deserializedFileShareListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFileShareListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareListResult; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/models/FileShareSnapshotListResult.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/models/FileShareSnapshotListResult.java new file mode 100644 index 000000000000..9262b4a5e2f3 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/models/FileShareSnapshotListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation.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.fileshares.fluent.models.FileShareSnapshotInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a FileShareSnapshot list operation. + */ +@Immutable +public final class FileShareSnapshotListResult implements JsonSerializable { + /* + * The FileShareSnapshot items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of FileShareSnapshotListResult class. + */ + private FileShareSnapshotListResult() { + } + + /** + * Get the value property: The FileShareSnapshot items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareSnapshotListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareSnapshotListResult 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 FileShareSnapshotListResult. + */ + public static FileShareSnapshotListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareSnapshotListResult deserializedFileShareSnapshotListResult = new FileShareSnapshotListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FileShareSnapshotInner.fromJson(reader1)); + deserializedFileShareSnapshotListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFileShareSnapshotListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareSnapshotListResult; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/models/OperationListResult.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..2c5c550e4eff --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/models/OperationListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation.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.fileshares.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The Operation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The Operation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + 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 IllegalStateException If the deserialized JSON object was missing any required properties. + * @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/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/models/PrivateEndpointConnectionListResult.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 000000000000..3cf5e8b95491 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation.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.fileshares.fluent.models.PrivateEndpointConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a PrivateEndpointConnection list operation. + */ +@Immutable +public final class PrivateEndpointConnectionListResult + implements JsonSerializable { + /* + * The PrivateEndpointConnection items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PrivateEndpointConnectionListResult class. + */ + private PrivateEndpointConnectionListResult() { + } + + /** + * Get the value property: The PrivateEndpointConnection items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + 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 IllegalStateException If the deserialized JSON object was missing any required properties. + * @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/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/models/PrivateLinkResourceListResult.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/models/PrivateLinkResourceListResult.java new file mode 100644 index 000000000000..2035e53ae1e6 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/models/PrivateLinkResourceListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.implementation.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.fileshares.fluent.models.PrivateLinkResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of private link resources. + */ +@Immutable +public final class PrivateLinkResourceListResult implements JsonSerializable { + /* + * The PrivateLinkResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PrivateLinkResourceListResult class. + */ + private PrivateLinkResourceListResult() { + } + + /** + * Get the value property: The PrivateLinkResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + 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 IllegalStateException If the deserialized JSON object was missing any required properties. + * @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/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/package-info.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/implementation/package-info.java new file mode 100644 index 000000000000..a3589053e59a --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/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) TypeSpec Code Generator. + +/** + * Package containing the implementations for FilesharesManagementClient. + * Azure File Shares Resource Provider API. + */ +package com.azure.resourcemanager.fileshares.implementation; diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/ActionType.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/ActionType.java new file mode 100644 index 000000000000..76d6d9a2e21a --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/CheckNameAvailabilityReason.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/CheckNameAvailabilityReason.java new file mode 100644 index 000000000000..203fa4510222 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/CheckNameAvailabilityReason.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Possible reasons for a name not being available. + */ +public final class CheckNameAvailabilityReason extends ExpandableStringEnum { + /** + * Name is invalid. + */ + public static final CheckNameAvailabilityReason INVALID = fromString("Invalid"); + + /** + * Name already exists. + */ + public static final CheckNameAvailabilityReason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates a new instance of CheckNameAvailabilityReason value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CheckNameAvailabilityReason() { + } + + /** + * Creates or finds a CheckNameAvailabilityReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding CheckNameAvailabilityReason. + */ + public static CheckNameAvailabilityReason fromString(String name) { + return fromString(name, CheckNameAvailabilityReason.class); + } + + /** + * Gets known CheckNameAvailabilityReason values. + * + * @return known CheckNameAvailabilityReason values. + */ + public static Collection values() { + return values(CheckNameAvailabilityReason.class); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/CheckNameAvailabilityRequest.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/CheckNameAvailabilityRequest.java new file mode 100644 index 000000000000..a6d4a8c70975 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/CheckNameAvailabilityRequest.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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 check availability request body. + */ +@Fluent +public final class CheckNameAvailabilityRequest implements JsonSerializable { + /* + * The name of the resource for which availability needs to be checked. + */ + private String name; + + /* + * The resource type. + */ + private String type; + + /** + * Creates an instance of CheckNameAvailabilityRequest class. + */ + public CheckNameAvailabilityRequest() { + } + + /** + * Get the name property: The name of the resource for which availability needs to be checked. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource for which availability needs to be checked. + * + * @param name the name value to set. + * @return the CheckNameAvailabilityRequest object itself. + */ + public CheckNameAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The resource type. + * + * @param type the type value to set. + * @return the CheckNameAvailabilityRequest object itself. + */ + public CheckNameAvailabilityRequest withType(String type) { + this.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityRequest 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 CheckNameAvailabilityRequest. + */ + public static CheckNameAvailabilityRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityRequest deserializedCheckNameAvailabilityRequest = new CheckNameAvailabilityRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCheckNameAvailabilityRequest.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCheckNameAvailabilityRequest.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityRequest; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/CheckNameAvailabilityResponse.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/CheckNameAvailabilityResponse.java new file mode 100644 index 000000000000..6e319a9d158f --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/CheckNameAvailabilityResponse.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.resourcemanager.fileshares.fluent.models.CheckNameAvailabilityResponseInner; + +/** + * An immutable client-side representation of CheckNameAvailabilityResponse. + */ +public interface CheckNameAvailabilityResponse { + /** + * Gets the nameAvailable property: Indicates if the resource name is available. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: The reason why the given name is not available. + * + * @return the reason value. + */ + CheckNameAvailabilityReason reason(); + + /** + * Gets the message property: Detailed reason why the given name is not available. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.fileshares.fluent.models.CheckNameAvailabilityResponseInner object. + * + * @return the inner object. + */ + CheckNameAvailabilityResponseInner innerModel(); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/EncryptionInTransitRequired.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/EncryptionInTransitRequired.java new file mode 100644 index 000000000000..d220672ae3f7 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/EncryptionInTransitRequired.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * State of NFS encryption in transit. + */ +public final class EncryptionInTransitRequired extends ExpandableStringEnum { + /** + * Encryption in Transit is enabled. + */ + public static final EncryptionInTransitRequired ENABLED = fromString("Enabled"); + + /** + * Encryption in Transit is disabled. + */ + public static final EncryptionInTransitRequired DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of EncryptionInTransitRequired value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EncryptionInTransitRequired() { + } + + /** + * Creates or finds a EncryptionInTransitRequired from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionInTransitRequired. + */ + public static EncryptionInTransitRequired fromString(String name) { + return fromString(name, EncryptionInTransitRequired.class); + } + + /** + * Gets known EncryptionInTransitRequired values. + * + * @return known EncryptionInTransitRequired values. + */ + public static Collection values() { + return values(EncryptionInTransitRequired.class); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShare.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShare.java new file mode 100644 index 000000000000..ec99c5f89531 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShare.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareInner; +import java.util.Map; + +/** + * An immutable client-side representation of FileShare. + */ +public interface FileShare { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + FileShareProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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.fileshares.fluent.models.FileShareInner object. + * + * @return the inner object. + */ + FileShareInner innerModel(); + + /** + * The entirety of the FileShare definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The FileShare definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the FileShare definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the FileShare 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 FileShare 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 FileShare 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + FileShare create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FileShare create(Context context); + } + + /** + * The stage of the FileShare 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 FileShare definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(FileShareProperties properties); + } + } + + /** + * Begins update for the FileShare resource. + * + * @return the stage of resource update. + */ + FileShare.Update update(); + + /** + * The template for FileShare update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FileShare apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FileShare apply(Context context); + } + + /** + * The FileShare update stages. + */ + interface UpdateStages { + /** + * The stage of the FileShare 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 FileShare update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(FileShareUpdateProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FileShare refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FileShare refresh(Context context); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareLimits.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareLimits.java new file mode 100644 index 000000000000..41052ca17ccc --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareLimits.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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; + +/** + * File share-related limits in the specified subscription/location. + */ +@Immutable +public final class FileShareLimits implements JsonSerializable { + /* + * The maximum number of file shares that can be created. + */ + private int maxFileShares; + + /* + * The maximum number of snapshots allowed per file share. + */ + private int maxFileShareSnapshots; + + /* + * The maximum number of subnets that can be associated with a file share. + */ + private int maxFileShareSubnets; + + /* + * The maximum number of private endpoint connections allowed for a file share. + */ + private int maxFileSharePrivateEndpointConnections; + + /* + * The minimum provisioned storage in GiB for a file share. + */ + private int minProvisionedStorageGiB; + + /* + * The maximum provisioned storage in GiB for a file share. + */ + private int maxProvisionedStorageGiB; + + /* + * The minimum provisioned IOPS (Input/Output Operations Per Second) for a file share. + */ + private int minProvisionedIOPerSec; + + /* + * The maximum provisioned IOPS (Input/Output Operations Per Second) for a file share. + */ + private int maxProvisionedIOPerSec; + + /* + * The minimum provisioned throughput in MiB/s for a file share. + */ + private int minProvisionedThroughputMiBPerSec; + + /* + * The maximum provisioned throughput in MiB/s for a file share. + */ + private int maxProvisionedThroughputMiBPerSec; + + /** + * Creates an instance of FileShareLimits class. + */ + private FileShareLimits() { + } + + /** + * Get the maxFileShares property: The maximum number of file shares that can be created. + * + * @return the maxFileShares value. + */ + public int maxFileShares() { + return this.maxFileShares; + } + + /** + * Get the maxFileShareSnapshots property: The maximum number of snapshots allowed per file share. + * + * @return the maxFileShareSnapshots value. + */ + public int maxFileShareSnapshots() { + return this.maxFileShareSnapshots; + } + + /** + * Get the maxFileShareSubnets property: The maximum number of subnets that can be associated with a file share. + * + * @return the maxFileShareSubnets value. + */ + public int maxFileShareSubnets() { + return this.maxFileShareSubnets; + } + + /** + * Get the maxFileSharePrivateEndpointConnections property: The maximum number of private endpoint connections + * allowed for a file share. + * + * @return the maxFileSharePrivateEndpointConnections value. + */ + public int maxFileSharePrivateEndpointConnections() { + return this.maxFileSharePrivateEndpointConnections; + } + + /** + * Get the minProvisionedStorageGiB property: The minimum provisioned storage in GiB for a file share. + * + * @return the minProvisionedStorageGiB value. + */ + public int minProvisionedStorageGiB() { + return this.minProvisionedStorageGiB; + } + + /** + * Get the maxProvisionedStorageGiB property: The maximum provisioned storage in GiB for a file share. + * + * @return the maxProvisionedStorageGiB value. + */ + public int maxProvisionedStorageGiB() { + return this.maxProvisionedStorageGiB; + } + + /** + * Get the minProvisionedIOPerSec property: The minimum provisioned IOPS (Input/Output Operations Per Second) for a + * file share. + * + * @return the minProvisionedIOPerSec value. + */ + public int minProvisionedIOPerSec() { + return this.minProvisionedIOPerSec; + } + + /** + * Get the maxProvisionedIOPerSec property: The maximum provisioned IOPS (Input/Output Operations Per Second) for a + * file share. + * + * @return the maxProvisionedIOPerSec value. + */ + public int maxProvisionedIOPerSec() { + return this.maxProvisionedIOPerSec; + } + + /** + * Get the minProvisionedThroughputMiBPerSec property: The minimum provisioned throughput in MiB/s for a file share. + * + * @return the minProvisionedThroughputMiBPerSec value. + */ + public int minProvisionedThroughputMiBPerSec() { + return this.minProvisionedThroughputMiBPerSec; + } + + /** + * Get the maxProvisionedThroughputMiBPerSec property: The maximum provisioned throughput in MiB/s for a file share. + * + * @return the maxProvisionedThroughputMiBPerSec value. + */ + public int maxProvisionedThroughputMiBPerSec() { + return this.maxProvisionedThroughputMiBPerSec; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("maxFileShares", this.maxFileShares); + jsonWriter.writeIntField("maxFileShareSnapshots", this.maxFileShareSnapshots); + jsonWriter.writeIntField("maxFileShareSubnets", this.maxFileShareSubnets); + jsonWriter.writeIntField("maxFileSharePrivateEndpointConnections", this.maxFileSharePrivateEndpointConnections); + jsonWriter.writeIntField("minProvisionedStorageGiB", this.minProvisionedStorageGiB); + jsonWriter.writeIntField("maxProvisionedStorageGiB", this.maxProvisionedStorageGiB); + jsonWriter.writeIntField("minProvisionedIOPerSec", this.minProvisionedIOPerSec); + jsonWriter.writeIntField("maxProvisionedIOPerSec", this.maxProvisionedIOPerSec); + jsonWriter.writeIntField("minProvisionedThroughputMiBPerSec", this.minProvisionedThroughputMiBPerSec); + jsonWriter.writeIntField("maxProvisionedThroughputMiBPerSec", this.maxProvisionedThroughputMiBPerSec); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareLimits from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareLimits 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 FileShareLimits. + */ + public static FileShareLimits fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareLimits deserializedFileShareLimits = new FileShareLimits(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("maxFileShares".equals(fieldName)) { + deserializedFileShareLimits.maxFileShares = reader.getInt(); + } else if ("maxFileShareSnapshots".equals(fieldName)) { + deserializedFileShareLimits.maxFileShareSnapshots = reader.getInt(); + } else if ("maxFileShareSubnets".equals(fieldName)) { + deserializedFileShareLimits.maxFileShareSubnets = reader.getInt(); + } else if ("maxFileSharePrivateEndpointConnections".equals(fieldName)) { + deserializedFileShareLimits.maxFileSharePrivateEndpointConnections = reader.getInt(); + } else if ("minProvisionedStorageGiB".equals(fieldName)) { + deserializedFileShareLimits.minProvisionedStorageGiB = reader.getInt(); + } else if ("maxProvisionedStorageGiB".equals(fieldName)) { + deserializedFileShareLimits.maxProvisionedStorageGiB = reader.getInt(); + } else if ("minProvisionedIOPerSec".equals(fieldName)) { + deserializedFileShareLimits.minProvisionedIOPerSec = reader.getInt(); + } else if ("maxProvisionedIOPerSec".equals(fieldName)) { + deserializedFileShareLimits.maxProvisionedIOPerSec = reader.getInt(); + } else if ("minProvisionedThroughputMiBPerSec".equals(fieldName)) { + deserializedFileShareLimits.minProvisionedThroughputMiBPerSec = reader.getInt(); + } else if ("maxProvisionedThroughputMiBPerSec".equals(fieldName)) { + deserializedFileShareLimits.maxProvisionedThroughputMiBPerSec = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareLimits; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareLimitsOutput.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareLimitsOutput.java new file mode 100644 index 000000000000..5f660e2a646e --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareLimitsOutput.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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; + +/** + * File share limits API result. + */ +@Immutable +public final class FileShareLimitsOutput implements JsonSerializable { + /* + * The limits for the file share. + */ + private FileShareLimits limits; + + /* + * The provisioning constants for the file share. + */ + private FileShareProvisioningConstants provisioningConstants; + + /** + * Creates an instance of FileShareLimitsOutput class. + */ + private FileShareLimitsOutput() { + } + + /** + * Get the limits property: The limits for the file share. + * + * @return the limits value. + */ + public FileShareLimits limits() { + return this.limits; + } + + /** + * Get the provisioningConstants property: The provisioning constants for the file share. + * + * @return the provisioningConstants value. + */ + public FileShareProvisioningConstants provisioningConstants() { + return this.provisioningConstants; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("limits", this.limits); + jsonWriter.writeJsonField("provisioningConstants", this.provisioningConstants); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareLimitsOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareLimitsOutput 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 FileShareLimitsOutput. + */ + public static FileShareLimitsOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareLimitsOutput deserializedFileShareLimitsOutput = new FileShareLimitsOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("limits".equals(fieldName)) { + deserializedFileShareLimitsOutput.limits = FileShareLimits.fromJson(reader); + } else if ("provisioningConstants".equals(fieldName)) { + deserializedFileShareLimitsOutput.provisioningConstants + = FileShareProvisioningConstants.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareLimitsOutput; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareLimitsResponse.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareLimitsResponse.java new file mode 100644 index 000000000000..d80fd997dd86 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareLimitsResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.resourcemanager.fileshares.fluent.models.FileShareLimitsResponseInner; + +/** + * An immutable client-side representation of FileShareLimitsResponse. + */ +public interface FileShareLimitsResponse { + /** + * Gets the properties property: The properties of the file share limits. + * + * @return the properties value. + */ + FileShareLimitsOutput properties(); + + /** + * Gets the inner com.azure.resourcemanager.fileshares.fluent.models.FileShareLimitsResponseInner object. + * + * @return the inner object. + */ + FileShareLimitsResponseInner innerModel(); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProperties.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProperties.java new file mode 100644 index 000000000000..10ab3aeeb99d --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProperties.java @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.fileshares.fluent.models.PrivateEndpointConnectionInner; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * File share properties. + */ +@Fluent +public final class FileShareProperties implements JsonSerializable { + /* + * The name of the file share as seen by the end user when mounting the share, such as in a URI or UNC format in + * their operating system. + */ + private String mountName; + + /* + * The host name of the file share. + */ + private String hostName; + + /* + * The storage media tier of the file share. + */ + private MediaTier mediaTier; + + /* + * The chosen redundancy level of the file share. + */ + private Redundancy redundancy; + + /* + * The file sharing protocol for this file share. + */ + private Protocol protocol; + + /* + * The provisioned storage size of the share in GiB (1 GiB is 1024^3 bytes or 1073741824 bytes). A component of the + * file share's bill is the provisioned storage, regardless of the amount of used storage. + */ + private Integer provisionedStorageGiB; + + /* + * A date/time value that specifies when the provisioned storage for the file share is permitted to be reduced. + */ + private OffsetDateTime provisionedStorageNextAllowedDowngrade; + + /* + * The provisioned IO / sec of the share. + */ + private Integer provisionedIOPerSec; + + /* + * A date/time value that specifies when the provisioned IOPS for the file share is permitted to be reduced. + */ + private OffsetDateTime provisionedIOPerSecNextAllowedDowngrade; + + /* + * The provisioned throughput / sec of the share. + */ + private Integer provisionedThroughputMiBPerSec; + + /* + * A date/time value that specifies when the provisioned throughput for the file share is permitted to be reduced. + */ + private OffsetDateTime provisionedThroughputNextAllowedDowngrade; + + /* + * Burst IOPS are extra buffer IOPS enabling you to consume more than your provisioned IOPS for a short period of + * time, depending on the burst credits available for your share. + */ + private Integer includedBurstIOPerSec; + + /* + * Max burst IOPS credits shows the maximum number of burst credits the share can have at the current IOPS + * provisioning level. + */ + private Long maxBurstIOPerSecCredits; + + /* + * Protocol settings specific NFS. + */ + private NfsProtocolProperties nfsProtocolProperties; + + /* + * The set of properties for control public access. + */ + private PublicAccessProperties publicAccessProperties; + + /* + * The status of the last operation. + */ + private FileShareProvisioningState provisioningState; + + /* + * Gets or sets allow or disallow public network access to azure managed file share + */ + private PublicNetworkAccess publicNetworkAccess; + + /* + * The list of associated private endpoint connections. + */ + private List privateEndpointConnections; + + /** + * Creates an instance of FileShareProperties class. + */ + public FileShareProperties() { + } + + /** + * Get the mountName property: The name of the file share as seen by the end user when mounting the share, such as + * in a URI or UNC format in their operating system. + * + * @return the mountName value. + */ + public String mountName() { + return this.mountName; + } + + /** + * Set the mountName property: The name of the file share as seen by the end user when mounting the share, such as + * in a URI or UNC format in their operating system. + * + * @param mountName the mountName value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withMountName(String mountName) { + this.mountName = mountName; + return this; + } + + /** + * Get the hostName property: The host name of the file share. + * + * @return the hostName value. + */ + public String hostName() { + return this.hostName; + } + + /** + * Get the mediaTier property: The storage media tier of the file share. + * + * @return the mediaTier value. + */ + public MediaTier mediaTier() { + return this.mediaTier; + } + + /** + * Set the mediaTier property: The storage media tier of the file share. + * + * @param mediaTier the mediaTier value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withMediaTier(MediaTier mediaTier) { + this.mediaTier = mediaTier; + return this; + } + + /** + * Get the redundancy property: The chosen redundancy level of the file share. + * + * @return the redundancy value. + */ + public Redundancy redundancy() { + return this.redundancy; + } + + /** + * Set the redundancy property: The chosen redundancy level of the file share. + * + * @param redundancy the redundancy value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withRedundancy(Redundancy redundancy) { + this.redundancy = redundancy; + return this; + } + + /** + * Get the protocol property: The file sharing protocol for this file share. + * + * @return the protocol value. + */ + public Protocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The file sharing protocol for this file share. + * + * @param protocol the protocol value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withProtocol(Protocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the provisionedStorageGiB property: The provisioned storage size of the share in GiB (1 GiB is 1024^3 bytes + * or 1073741824 bytes). A component of the file share's bill is the provisioned storage, regardless of the amount + * of used storage. + * + * @return the provisionedStorageGiB value. + */ + public Integer provisionedStorageGiB() { + return this.provisionedStorageGiB; + } + + /** + * Set the provisionedStorageGiB property: The provisioned storage size of the share in GiB (1 GiB is 1024^3 bytes + * or 1073741824 bytes). A component of the file share's bill is the provisioned storage, regardless of the amount + * of used storage. + * + * @param provisionedStorageGiB the provisionedStorageGiB value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withProvisionedStorageGiB(Integer provisionedStorageGiB) { + this.provisionedStorageGiB = provisionedStorageGiB; + return this; + } + + /** + * Get the provisionedStorageNextAllowedDowngrade property: A date/time value that specifies when the provisioned + * storage for the file share is permitted to be reduced. + * + * @return the provisionedStorageNextAllowedDowngrade value. + */ + public OffsetDateTime provisionedStorageNextAllowedDowngrade() { + return this.provisionedStorageNextAllowedDowngrade; + } + + /** + * Get the provisionedIOPerSec property: The provisioned IO / sec of the share. + * + * @return the provisionedIOPerSec value. + */ + public Integer provisionedIOPerSec() { + return this.provisionedIOPerSec; + } + + /** + * Set the provisionedIOPerSec property: The provisioned IO / sec of the share. + * + * @param provisionedIOPerSec the provisionedIOPerSec value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withProvisionedIOPerSec(Integer provisionedIOPerSec) { + this.provisionedIOPerSec = provisionedIOPerSec; + return this; + } + + /** + * Get the provisionedIOPerSecNextAllowedDowngrade property: A date/time value that specifies when the provisioned + * IOPS for the file share is permitted to be reduced. + * + * @return the provisionedIOPerSecNextAllowedDowngrade value. + */ + public OffsetDateTime provisionedIOPerSecNextAllowedDowngrade() { + return this.provisionedIOPerSecNextAllowedDowngrade; + } + + /** + * Get the provisionedThroughputMiBPerSec property: The provisioned throughput / sec of the share. + * + * @return the provisionedThroughputMiBPerSec value. + */ + public Integer provisionedThroughputMiBPerSec() { + return this.provisionedThroughputMiBPerSec; + } + + /** + * Set the provisionedThroughputMiBPerSec property: The provisioned throughput / sec of the share. + * + * @param provisionedThroughputMiBPerSec the provisionedThroughputMiBPerSec value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withProvisionedThroughputMiBPerSec(Integer provisionedThroughputMiBPerSec) { + this.provisionedThroughputMiBPerSec = provisionedThroughputMiBPerSec; + return this; + } + + /** + * Get the provisionedThroughputNextAllowedDowngrade property: A date/time value that specifies when the provisioned + * throughput for the file share is permitted to be reduced. + * + * @return the provisionedThroughputNextAllowedDowngrade value. + */ + public OffsetDateTime provisionedThroughputNextAllowedDowngrade() { + return this.provisionedThroughputNextAllowedDowngrade; + } + + /** + * Get the includedBurstIOPerSec property: Burst IOPS are extra buffer IOPS enabling you to consume more than your + * provisioned IOPS for a short period of time, depending on the burst credits available for your share. + * + * @return the includedBurstIOPerSec value. + */ + public Integer includedBurstIOPerSec() { + return this.includedBurstIOPerSec; + } + + /** + * Get the maxBurstIOPerSecCredits property: Max burst IOPS credits shows the maximum number of burst credits the + * share can have at the current IOPS provisioning level. + * + * @return the maxBurstIOPerSecCredits value. + */ + public Long maxBurstIOPerSecCredits() { + return this.maxBurstIOPerSecCredits; + } + + /** + * Get the nfsProtocolProperties property: Protocol settings specific NFS. + * + * @return the nfsProtocolProperties value. + */ + public NfsProtocolProperties nfsProtocolProperties() { + return this.nfsProtocolProperties; + } + + /** + * Set the nfsProtocolProperties property: Protocol settings specific NFS. + * + * @param nfsProtocolProperties the nfsProtocolProperties value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withNfsProtocolProperties(NfsProtocolProperties nfsProtocolProperties) { + this.nfsProtocolProperties = nfsProtocolProperties; + return this; + } + + /** + * Get the publicAccessProperties property: The set of properties for control public access. + * + * @return the publicAccessProperties value. + */ + public PublicAccessProperties publicAccessProperties() { + return this.publicAccessProperties; + } + + /** + * Set the publicAccessProperties property: The set of properties for control public access. + * + * @param publicAccessProperties the publicAccessProperties value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withPublicAccessProperties(PublicAccessProperties publicAccessProperties) { + this.publicAccessProperties = publicAccessProperties; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public FileShareProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the publicNetworkAccess property: Gets or sets allow or disallow public network access to azure managed file + * share. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Gets or sets allow or disallow public network access to azure managed file + * share. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the FileShareProperties object itself. + */ + public FileShareProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the privateEndpointConnections property: The list of associated private endpoint connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mountName", this.mountName); + jsonWriter.writeStringField("mediaTier", this.mediaTier == null ? null : this.mediaTier.toString()); + jsonWriter.writeStringField("redundancy", this.redundancy == null ? null : this.redundancy.toString()); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeNumberField("provisionedStorageGiB", this.provisionedStorageGiB); + jsonWriter.writeNumberField("provisionedIOPerSec", this.provisionedIOPerSec); + jsonWriter.writeNumberField("provisionedThroughputMiBPerSec", this.provisionedThroughputMiBPerSec); + jsonWriter.writeJsonField("nfsProtocolProperties", this.nfsProtocolProperties); + jsonWriter.writeJsonField("publicAccessProperties", this.publicAccessProperties); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareProperties 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 FileShareProperties. + */ + public static FileShareProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareProperties deserializedFileShareProperties = new FileShareProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mountName".equals(fieldName)) { + deserializedFileShareProperties.mountName = reader.getString(); + } else if ("hostName".equals(fieldName)) { + deserializedFileShareProperties.hostName = reader.getString(); + } else if ("mediaTier".equals(fieldName)) { + deserializedFileShareProperties.mediaTier = MediaTier.fromString(reader.getString()); + } else if ("redundancy".equals(fieldName)) { + deserializedFileShareProperties.redundancy = Redundancy.fromString(reader.getString()); + } else if ("protocol".equals(fieldName)) { + deserializedFileShareProperties.protocol = Protocol.fromString(reader.getString()); + } else if ("provisionedStorageGiB".equals(fieldName)) { + deserializedFileShareProperties.provisionedStorageGiB = reader.getNullable(JsonReader::getInt); + } else if ("provisionedStorageNextAllowedDowngrade".equals(fieldName)) { + deserializedFileShareProperties.provisionedStorageNextAllowedDowngrade = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("provisionedIOPerSec".equals(fieldName)) { + deserializedFileShareProperties.provisionedIOPerSec = reader.getNullable(JsonReader::getInt); + } else if ("provisionedIOPerSecNextAllowedDowngrade".equals(fieldName)) { + deserializedFileShareProperties.provisionedIOPerSecNextAllowedDowngrade = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("provisionedThroughputMiBPerSec".equals(fieldName)) { + deserializedFileShareProperties.provisionedThroughputMiBPerSec + = reader.getNullable(JsonReader::getInt); + } else if ("provisionedThroughputNextAllowedDowngrade".equals(fieldName)) { + deserializedFileShareProperties.provisionedThroughputNextAllowedDowngrade = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("includedBurstIOPerSec".equals(fieldName)) { + deserializedFileShareProperties.includedBurstIOPerSec = reader.getNullable(JsonReader::getInt); + } else if ("maxBurstIOPerSecCredits".equals(fieldName)) { + deserializedFileShareProperties.maxBurstIOPerSecCredits = reader.getNullable(JsonReader::getLong); + } else if ("nfsProtocolProperties".equals(fieldName)) { + deserializedFileShareProperties.nfsProtocolProperties = NfsProtocolProperties.fromJson(reader); + } else if ("publicAccessProperties".equals(fieldName)) { + deserializedFileShareProperties.publicAccessProperties = PublicAccessProperties.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedFileShareProperties.provisioningState + = FileShareProvisioningState.fromString(reader.getString()); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedFileShareProperties.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedFileShareProperties.privateEndpointConnections = privateEndpointConnections; + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareProperties; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningConstants.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningConstants.java new file mode 100644 index 000000000000..9c4fa2cf4984 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningConstants.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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; + +/** + * Constants used for calculating recommended values of file share provisioning properties. + */ +@Immutable +public final class FileShareProvisioningConstants implements JsonSerializable { + /* + * Base IO per second. + */ + private int baseIOPerSec; + + /* + * Scalar IO per second. + */ + private double scalarIOPerSec; + + /* + * Base throughput in MiB per second. + */ + private int baseThroughputMiBPerSec; + + /* + * Scalar throughput in MiB per second. + */ + private double scalarThroughputMiBPerSec; + + /* + * Guardrail scalar IO per second. + */ + private double guardrailIOPerSecScalar; + + /* + * Guardrail scalar throughput in MiB per second. + */ + private double guardrailThroughputScalar; + + /** + * Creates an instance of FileShareProvisioningConstants class. + */ + private FileShareProvisioningConstants() { + } + + /** + * Get the baseIOPerSec property: Base IO per second. + * + * @return the baseIOPerSec value. + */ + public int baseIOPerSec() { + return this.baseIOPerSec; + } + + /** + * Get the scalarIOPerSec property: Scalar IO per second. + * + * @return the scalarIOPerSec value. + */ + public double scalarIOPerSec() { + return this.scalarIOPerSec; + } + + /** + * Get the baseThroughputMiBPerSec property: Base throughput in MiB per second. + * + * @return the baseThroughputMiBPerSec value. + */ + public int baseThroughputMiBPerSec() { + return this.baseThroughputMiBPerSec; + } + + /** + * Get the scalarThroughputMiBPerSec property: Scalar throughput in MiB per second. + * + * @return the scalarThroughputMiBPerSec value. + */ + public double scalarThroughputMiBPerSec() { + return this.scalarThroughputMiBPerSec; + } + + /** + * Get the guardrailIOPerSecScalar property: Guardrail scalar IO per second. + * + * @return the guardrailIOPerSecScalar value. + */ + public double guardrailIOPerSecScalar() { + return this.guardrailIOPerSecScalar; + } + + /** + * Get the guardrailThroughputScalar property: Guardrail scalar throughput in MiB per second. + * + * @return the guardrailThroughputScalar value. + */ + public double guardrailThroughputScalar() { + return this.guardrailThroughputScalar; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("baseIOPerSec", this.baseIOPerSec); + jsonWriter.writeDoubleField("scalarIOPerSec", this.scalarIOPerSec); + jsonWriter.writeIntField("baseThroughputMiBPerSec", this.baseThroughputMiBPerSec); + jsonWriter.writeDoubleField("scalarThroughputMiBPerSec", this.scalarThroughputMiBPerSec); + jsonWriter.writeDoubleField("guardrailIOPerSecScalar", this.guardrailIOPerSecScalar); + jsonWriter.writeDoubleField("guardrailThroughputScalar", this.guardrailThroughputScalar); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareProvisioningConstants from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareProvisioningConstants 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 FileShareProvisioningConstants. + */ + public static FileShareProvisioningConstants fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareProvisioningConstants deserializedFileShareProvisioningConstants + = new FileShareProvisioningConstants(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("baseIOPerSec".equals(fieldName)) { + deserializedFileShareProvisioningConstants.baseIOPerSec = reader.getInt(); + } else if ("scalarIOPerSec".equals(fieldName)) { + deserializedFileShareProvisioningConstants.scalarIOPerSec = reader.getDouble(); + } else if ("baseThroughputMiBPerSec".equals(fieldName)) { + deserializedFileShareProvisioningConstants.baseThroughputMiBPerSec = reader.getInt(); + } else if ("scalarThroughputMiBPerSec".equals(fieldName)) { + deserializedFileShareProvisioningConstants.scalarThroughputMiBPerSec = reader.getDouble(); + } else if ("guardrailIOPerSecScalar".equals(fieldName)) { + deserializedFileShareProvisioningConstants.guardrailIOPerSecScalar = reader.getDouble(); + } else if ("guardrailThroughputScalar".equals(fieldName)) { + deserializedFileShareProvisioningConstants.guardrailThroughputScalar = reader.getDouble(); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareProvisioningConstants; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationInput.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationInput.java new file mode 100644 index 000000000000..b92ee7e9f4a5 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationInput.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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; + +/** + * File share provisioning parameters recommendation API input structure. + */ +@Fluent +public final class FileShareProvisioningRecommendationInput + implements JsonSerializable { + /* + * The desired provisioned storage size of the share in GiB. Will be use to calculate the values of remaining + * provisioning parameters. + */ + private int provisionedStorageGiB; + + /** + * Creates an instance of FileShareProvisioningRecommendationInput class. + */ + public FileShareProvisioningRecommendationInput() { + } + + /** + * Get the provisionedStorageGiB property: The desired provisioned storage size of the share in GiB. Will be use to + * calculate the values of remaining provisioning parameters. + * + * @return the provisionedStorageGiB value. + */ + public int provisionedStorageGiB() { + return this.provisionedStorageGiB; + } + + /** + * Set the provisionedStorageGiB property: The desired provisioned storage size of the share in GiB. Will be use to + * calculate the values of remaining provisioning parameters. + * + * @param provisionedStorageGiB the provisionedStorageGiB value to set. + * @return the FileShareProvisioningRecommendationInput object itself. + */ + public FileShareProvisioningRecommendationInput withProvisionedStorageGiB(int provisionedStorageGiB) { + this.provisionedStorageGiB = provisionedStorageGiB; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("provisionedStorageGiB", this.provisionedStorageGiB); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareProvisioningRecommendationInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareProvisioningRecommendationInput 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 FileShareProvisioningRecommendationInput. + */ + public static FileShareProvisioningRecommendationInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareProvisioningRecommendationInput deserializedFileShareProvisioningRecommendationInput + = new FileShareProvisioningRecommendationInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisionedStorageGiB".equals(fieldName)) { + deserializedFileShareProvisioningRecommendationInput.provisionedStorageGiB = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareProvisioningRecommendationInput; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationOutput.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationOutput.java new file mode 100644 index 000000000000..d389b151d6f2 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationOutput.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.List; + +/** + * File share provisioning parameters recommendation API result. + */ +@Immutable +public final class FileShareProvisioningRecommendationOutput + implements JsonSerializable { + /* + * The recommended value of provisioned IO / sec of the share. + */ + private int provisionedIOPerSec; + + /* + * The recommended value of provisioned throughput / sec of the share. + */ + private int provisionedThroughputMiBPerSec; + + /* + * Redundancy options for the share. + */ + private List availableRedundancyOptions; + + /** + * Creates an instance of FileShareProvisioningRecommendationOutput class. + */ + private FileShareProvisioningRecommendationOutput() { + } + + /** + * Get the provisionedIOPerSec property: The recommended value of provisioned IO / sec of the share. + * + * @return the provisionedIOPerSec value. + */ + public int provisionedIOPerSec() { + return this.provisionedIOPerSec; + } + + /** + * Get the provisionedThroughputMiBPerSec property: The recommended value of provisioned throughput / sec of the + * share. + * + * @return the provisionedThroughputMiBPerSec value. + */ + public int provisionedThroughputMiBPerSec() { + return this.provisionedThroughputMiBPerSec; + } + + /** + * Get the availableRedundancyOptions property: Redundancy options for the share. + * + * @return the availableRedundancyOptions value. + */ + public List availableRedundancyOptions() { + return this.availableRedundancyOptions; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("provisionedIOPerSec", this.provisionedIOPerSec); + jsonWriter.writeIntField("provisionedThroughputMiBPerSec", this.provisionedThroughputMiBPerSec); + jsonWriter.writeArrayField("availableRedundancyOptions", this.availableRedundancyOptions, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareProvisioningRecommendationOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareProvisioningRecommendationOutput 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 FileShareProvisioningRecommendationOutput. + */ + public static FileShareProvisioningRecommendationOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareProvisioningRecommendationOutput deserializedFileShareProvisioningRecommendationOutput + = new FileShareProvisioningRecommendationOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisionedIOPerSec".equals(fieldName)) { + deserializedFileShareProvisioningRecommendationOutput.provisionedIOPerSec = reader.getInt(); + } else if ("provisionedThroughputMiBPerSec".equals(fieldName)) { + deserializedFileShareProvisioningRecommendationOutput.provisionedThroughputMiBPerSec + = reader.getInt(); + } else if ("availableRedundancyOptions".equals(fieldName)) { + List availableRedundancyOptions + = reader.readArray(reader1 -> Redundancy.fromString(reader1.getString())); + deserializedFileShareProvisioningRecommendationOutput.availableRedundancyOptions + = availableRedundancyOptions; + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareProvisioningRecommendationOutput; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationRequest.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationRequest.java new file mode 100644 index 000000000000..f815ed54a4c7 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationRequest.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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; + +/** + * Request structure for file share provisioning parameters recommendation API. + */ +@Fluent +public final class FileShareProvisioningRecommendationRequest + implements JsonSerializable { + /* + * The properties of the file share provisioning recommendation input. + */ + private FileShareProvisioningRecommendationInput properties; + + /** + * Creates an instance of FileShareProvisioningRecommendationRequest class. + */ + public FileShareProvisioningRecommendationRequest() { + } + + /** + * Get the properties property: The properties of the file share provisioning recommendation input. + * + * @return the properties value. + */ + public FileShareProvisioningRecommendationInput properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of the file share provisioning recommendation input. + * + * @param properties the properties value to set. + * @return the FileShareProvisioningRecommendationRequest object itself. + */ + public FileShareProvisioningRecommendationRequest + withProperties(FileShareProvisioningRecommendationInput properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareProvisioningRecommendationRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareProvisioningRecommendationRequest 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 FileShareProvisioningRecommendationRequest. + */ + public static FileShareProvisioningRecommendationRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareProvisioningRecommendationRequest deserializedFileShareProvisioningRecommendationRequest + = new FileShareProvisioningRecommendationRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedFileShareProvisioningRecommendationRequest.properties + = FileShareProvisioningRecommendationInput.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareProvisioningRecommendationRequest; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationResponse.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationResponse.java new file mode 100644 index 000000000000..a98daf2cfa30 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationResponse.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.resourcemanager.fileshares.fluent.models.FileShareProvisioningRecommendationResponseInner; + +/** + * An immutable client-side representation of FileShareProvisioningRecommendationResponse. + */ +public interface FileShareProvisioningRecommendationResponse { + /** + * Gets the properties property: The properties of the file share provisioning recommendation output. + * + * @return the properties value. + */ + FileShareProvisioningRecommendationOutput properties(); + + /** + * Gets the inner + * com.azure.resourcemanager.fileshares.fluent.models.FileShareProvisioningRecommendationResponseInner object. + * + * @return the inner object. + */ + FileShareProvisioningRecommendationResponseInner innerModel(); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningState.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningState.java new file mode 100644 index 000000000000..876700effbfe --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningState.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of file share's ProvisioningState. + */ +public final class FileShareProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final FileShareProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final FileShareProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final FileShareProvisioningState CANCELED = fromString("Canceled"); + + /** + * The operation is provisioning. + */ + public static final FileShareProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * The operation is updating. + */ + public static final FileShareProvisioningState UPDATING = fromString("Updating"); + + /** + * The operation is deleting. + */ + public static final FileShareProvisioningState DELETING = fromString("Deleting"); + + /** + * The operation is accepted. + */ + public static final FileShareProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * The resource has been created. + */ + public static final FileShareProvisioningState CREATED = fromString("Created"); + + /** + * The operation is in a transient failure state. + */ + public static final FileShareProvisioningState TRANSIENT_FAILURE = fromString("TransientFailure"); + + /** + * The resource is being created. + */ + public static final FileShareProvisioningState CREATING = fromString("Creating"); + + /** + * The resource is being patched. + */ + public static final FileShareProvisioningState PATCHING = fromString("Patching"); + + /** + * The resource is being posted. + */ + public static final FileShareProvisioningState POSTING = fromString("Posting"); + + /** + * Creates a new instance of FileShareProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FileShareProvisioningState() { + } + + /** + * Creates or finds a FileShareProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding FileShareProvisioningState. + */ + public static FileShareProvisioningState fromString(String name) { + return fromString(name, FileShareProvisioningState.class); + } + + /** + * Gets known FileShareProvisioningState values. + * + * @return known FileShareProvisioningState values. + */ + public static Collection values() { + return values(FileShareProvisioningState.class); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshot.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshot.java new file mode 100644 index 000000000000..272149c25554 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshot.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareSnapshotInner; + +/** + * An immutable client-side representation of FileShareSnapshot. + */ +public interface FileShareSnapshot { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + FileShareSnapshotProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.fileshares.fluent.models.FileShareSnapshotInner object. + * + * @return the inner object. + */ + FileShareSnapshotInner innerModel(); + + /** + * The entirety of the FileShareSnapshot definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The FileShareSnapshot definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the FileShareSnapshot definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the FileShareSnapshot definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, resourceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure + * Resource Manager. + * @return the next definition stage. + */ + WithCreate withExistingFileShare(String resourceGroupName, String resourceName); + } + + /** + * The stage of the FileShareSnapshot 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + FileShareSnapshot create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + FileShareSnapshot create(Context context); + } + + /** + * The stage of the FileShareSnapshot definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(FileShareSnapshotProperties properties); + } + } + + /** + * Begins update for the FileShareSnapshot resource. + * + * @return the stage of resource update. + */ + FileShareSnapshot.Update update(); + + /** + * The template for FileShareSnapshot update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + FileShareSnapshot apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + FileShareSnapshot apply(Context context); + } + + /** + * The FileShareSnapshot update stages. + */ + interface UpdateStages { + /** + * The stage of the FileShareSnapshot update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(FileShareSnapshotUpdateProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + FileShareSnapshot refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + FileShareSnapshot refresh(Context context); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshotProperties.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshotProperties.java new file mode 100644 index 000000000000..60e46211e7c3 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshotProperties.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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; + +/** + * FileShareSnapshot properties. + */ +@Fluent +public final class FileShareSnapshotProperties implements JsonSerializable { + /* + * The FileShareSnapshot time in UTC in string representation + */ + private String snapshotTime; + + /* + * The initiator of the FileShareSnapshot. This is a user-defined value. + */ + private String initiatorId; + + /* + * The metadata + */ + private Map metadata; + + /** + * Creates an instance of FileShareSnapshotProperties class. + */ + public FileShareSnapshotProperties() { + } + + /** + * Get the snapshotTime property: The FileShareSnapshot time in UTC in string representation. + * + * @return the snapshotTime value. + */ + public String snapshotTime() { + return this.snapshotTime; + } + + /** + * Get the initiatorId property: The initiator of the FileShareSnapshot. This is a user-defined value. + * + * @return the initiatorId value. + */ + public String initiatorId() { + return this.initiatorId; + } + + /** + * Set the initiatorId property: The initiator of the FileShareSnapshot. This is a user-defined value. + * + * @param initiatorId the initiatorId value to set. + * @return the FileShareSnapshotProperties object itself. + */ + public FileShareSnapshotProperties withInitiatorId(String initiatorId) { + this.initiatorId = initiatorId; + return this; + } + + /** + * Get the metadata property: The metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: The metadata. + * + * @param metadata the metadata value to set. + * @return the FileShareSnapshotProperties object itself. + */ + public FileShareSnapshotProperties withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("initiatorId", this.initiatorId); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareSnapshotProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareSnapshotProperties 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 FileShareSnapshotProperties. + */ + public static FileShareSnapshotProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareSnapshotProperties deserializedFileShareSnapshotProperties = new FileShareSnapshotProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("snapshotTime".equals(fieldName)) { + deserializedFileShareSnapshotProperties.snapshotTime = reader.getString(); + } else if ("initiatorId".equals(fieldName)) { + deserializedFileShareSnapshotProperties.initiatorId = reader.getString(); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedFileShareSnapshotProperties.metadata = metadata; + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareSnapshotProperties; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshotUpdate.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshotUpdate.java new file mode 100644 index 000000000000..d5509ad0e9f6 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshotUpdate.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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 type used for update operations of the FileShareSnapshot. + */ +@Fluent +public final class FileShareSnapshotUpdate implements JsonSerializable { + /* + * The resource-specific properties for this resource. + */ + private FileShareSnapshotUpdateProperties properties; + + /** + * Creates an instance of FileShareSnapshotUpdate class. + */ + public FileShareSnapshotUpdate() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public FileShareSnapshotUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the FileShareSnapshotUpdate object itself. + */ + public FileShareSnapshotUpdate withProperties(FileShareSnapshotUpdateProperties properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareSnapshotUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareSnapshotUpdate 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 FileShareSnapshotUpdate. + */ + public static FileShareSnapshotUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareSnapshotUpdate deserializedFileShareSnapshotUpdate = new FileShareSnapshotUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedFileShareSnapshotUpdate.properties = FileShareSnapshotUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareSnapshotUpdate; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshotUpdateProperties.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshotUpdateProperties.java new file mode 100644 index 000000000000..a45b767d4aad --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshotUpdateProperties.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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; + +/** + * The updatable properties of the FileShareSnapshot. + */ +@Fluent +public final class FileShareSnapshotUpdateProperties implements JsonSerializable { + /* + * The metadata + */ + private Map metadata; + + /** + * Creates an instance of FileShareSnapshotUpdateProperties class. + */ + public FileShareSnapshotUpdateProperties() { + } + + /** + * Get the metadata property: The metadata. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: The metadata. + * + * @param metadata the metadata value to set. + * @return the FileShareSnapshotUpdateProperties object itself. + */ + public FileShareSnapshotUpdateProperties withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareSnapshotUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareSnapshotUpdateProperties 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 FileShareSnapshotUpdateProperties. + */ + public static FileShareSnapshotUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareSnapshotUpdateProperties deserializedFileShareSnapshotUpdateProperties + = new FileShareSnapshotUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedFileShareSnapshotUpdateProperties.metadata = metadata; + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareSnapshotUpdateProperties; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshots.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshots.java new file mode 100644 index 000000000000..a0b6caeb3d24 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshots.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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 FileShareSnapshots. + */ +public interface FileShareSnapshots { + /** + * Get a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FileShareSnapshot along with {@link Response}. + */ + Response getFileShareSnapshotWithResponse(String resourceGroupName, String resourceName, + String name, Context context); + + /** + * Get a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FileShareSnapshot. + */ + FileShareSnapshot getFileShareSnapshot(String resourceGroupName, String resourceName, String name); + + /** + * Delete a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteFileShareSnapshot(String resourceGroupName, String resourceName, String name); + + /** + * Delete a FileShareSnapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param name The name of the FileShareSnapshot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteFileShareSnapshot(String resourceGroupName, String resourceName, String name, Context context); + + /** + * List FileShareSnapshot by FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShareSnapshot list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByFileShare(String resourceGroupName, String resourceName); + + /** + * List FileShareSnapshot by FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShareSnapshot list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByFileShare(String resourceGroupName, String resourceName, Context context); + + /** + * Get a FileShareSnapshot. + * + * @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 a FileShareSnapshot along with {@link Response}. + */ + FileShareSnapshot getFileShareSnapshotById(String id); + + /** + * Get a FileShareSnapshot. + * + * @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 a FileShareSnapshot along with {@link Response}. + */ + Response getFileShareSnapshotByIdWithResponse(String id, Context context); + + /** + * Delete a FileShareSnapshot. + * + * @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 deleteFileShareSnapshotById(String id); + + /** + * Delete a FileShareSnapshot. + * + * @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 deleteFileShareSnapshotByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new FileShareSnapshot resource. + * + * @param name resource name. + * @return the first stage of the new FileShareSnapshot definition. + */ + FileShareSnapshot.DefinitionStages.Blank define(String name); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUpdate.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUpdate.java new file mode 100644 index 000000000000..abd67dfa2ca2 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUpdate.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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; + +/** + * The type used for update operations of the FileShare. + */ +@Fluent +public final class FileShareUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /* + * The resource-specific properties for this resource. + */ + private FileShareUpdateProperties properties; + + /** + * Creates an instance of FileShareUpdate class. + */ + public FileShareUpdate() { + } + + /** + * 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 FileShareUpdate object itself. + */ + public FileShareUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public FileShareUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the FileShareUpdate object itself. + */ + public FileShareUpdate withProperties(FileShareUpdateProperties properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareUpdate 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 FileShareUpdate. + */ + public static FileShareUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareUpdate deserializedFileShareUpdate = new FileShareUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFileShareUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedFileShareUpdate.properties = FileShareUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareUpdate; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUpdateProperties.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUpdateProperties.java new file mode 100644 index 000000000000..54578b4738f3 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUpdateProperties.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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 updatable properties of the FileShare. + */ +@Fluent +public final class FileShareUpdateProperties implements JsonSerializable { + /* + * The provisioned storage size of the share in GiB (1 GiB is 1024^3 bytes or 1073741824 bytes). A component of the + * file share's bill is the provisioned storage, regardless of the amount of used storage. + */ + private Integer provisionedStorageGiB; + + /* + * The provisioned IO / sec of the share. + */ + private Integer provisionedIOPerSec; + + /* + * The provisioned throughput / sec of the share. + */ + private Integer provisionedThroughputMiBPerSec; + + /* + * Protocol settings specific NFS. + */ + private NfsProtocolProperties nfsProtocolProperties; + + /* + * The set of properties for control public access. + */ + private PublicAccessProperties publicAccessProperties; + + /* + * Gets or sets allow or disallow public network access to azure managed file share + */ + private PublicNetworkAccess publicNetworkAccess; + + /** + * Creates an instance of FileShareUpdateProperties class. + */ + public FileShareUpdateProperties() { + } + + /** + * Get the provisionedStorageGiB property: The provisioned storage size of the share in GiB (1 GiB is 1024^3 bytes + * or 1073741824 bytes). A component of the file share's bill is the provisioned storage, regardless of the amount + * of used storage. + * + * @return the provisionedStorageGiB value. + */ + public Integer provisionedStorageGiB() { + return this.provisionedStorageGiB; + } + + /** + * Set the provisionedStorageGiB property: The provisioned storage size of the share in GiB (1 GiB is 1024^3 bytes + * or 1073741824 bytes). A component of the file share's bill is the provisioned storage, regardless of the amount + * of used storage. + * + * @param provisionedStorageGiB the provisionedStorageGiB value to set. + * @return the FileShareUpdateProperties object itself. + */ + public FileShareUpdateProperties withProvisionedStorageGiB(Integer provisionedStorageGiB) { + this.provisionedStorageGiB = provisionedStorageGiB; + return this; + } + + /** + * Get the provisionedIOPerSec property: The provisioned IO / sec of the share. + * + * @return the provisionedIOPerSec value. + */ + public Integer provisionedIOPerSec() { + return this.provisionedIOPerSec; + } + + /** + * Set the provisionedIOPerSec property: The provisioned IO / sec of the share. + * + * @param provisionedIOPerSec the provisionedIOPerSec value to set. + * @return the FileShareUpdateProperties object itself. + */ + public FileShareUpdateProperties withProvisionedIOPerSec(Integer provisionedIOPerSec) { + this.provisionedIOPerSec = provisionedIOPerSec; + return this; + } + + /** + * Get the provisionedThroughputMiBPerSec property: The provisioned throughput / sec of the share. + * + * @return the provisionedThroughputMiBPerSec value. + */ + public Integer provisionedThroughputMiBPerSec() { + return this.provisionedThroughputMiBPerSec; + } + + /** + * Set the provisionedThroughputMiBPerSec property: The provisioned throughput / sec of the share. + * + * @param provisionedThroughputMiBPerSec the provisionedThroughputMiBPerSec value to set. + * @return the FileShareUpdateProperties object itself. + */ + public FileShareUpdateProperties withProvisionedThroughputMiBPerSec(Integer provisionedThroughputMiBPerSec) { + this.provisionedThroughputMiBPerSec = provisionedThroughputMiBPerSec; + return this; + } + + /** + * Get the nfsProtocolProperties property: Protocol settings specific NFS. + * + * @return the nfsProtocolProperties value. + */ + public NfsProtocolProperties nfsProtocolProperties() { + return this.nfsProtocolProperties; + } + + /** + * Set the nfsProtocolProperties property: Protocol settings specific NFS. + * + * @param nfsProtocolProperties the nfsProtocolProperties value to set. + * @return the FileShareUpdateProperties object itself. + */ + public FileShareUpdateProperties withNfsProtocolProperties(NfsProtocolProperties nfsProtocolProperties) { + this.nfsProtocolProperties = nfsProtocolProperties; + return this; + } + + /** + * Get the publicAccessProperties property: The set of properties for control public access. + * + * @return the publicAccessProperties value. + */ + public PublicAccessProperties publicAccessProperties() { + return this.publicAccessProperties; + } + + /** + * Set the publicAccessProperties property: The set of properties for control public access. + * + * @param publicAccessProperties the publicAccessProperties value to set. + * @return the FileShareUpdateProperties object itself. + */ + public FileShareUpdateProperties withPublicAccessProperties(PublicAccessProperties publicAccessProperties) { + this.publicAccessProperties = publicAccessProperties; + return this; + } + + /** + * Get the publicNetworkAccess property: Gets or sets allow or disallow public network access to azure managed file + * share. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Gets or sets allow or disallow public network access to azure managed file + * share. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the FileShareUpdateProperties object itself. + */ + public FileShareUpdateProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("provisionedStorageGiB", this.provisionedStorageGiB); + jsonWriter.writeNumberField("provisionedIOPerSec", this.provisionedIOPerSec); + jsonWriter.writeNumberField("provisionedThroughputMiBPerSec", this.provisionedThroughputMiBPerSec); + jsonWriter.writeJsonField("nfsProtocolProperties", this.nfsProtocolProperties); + jsonWriter.writeJsonField("publicAccessProperties", this.publicAccessProperties); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareUpdateProperties 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 FileShareUpdateProperties. + */ + public static FileShareUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareUpdateProperties deserializedFileShareUpdateProperties = new FileShareUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisionedStorageGiB".equals(fieldName)) { + deserializedFileShareUpdateProperties.provisionedStorageGiB + = reader.getNullable(JsonReader::getInt); + } else if ("provisionedIOPerSec".equals(fieldName)) { + deserializedFileShareUpdateProperties.provisionedIOPerSec = reader.getNullable(JsonReader::getInt); + } else if ("provisionedThroughputMiBPerSec".equals(fieldName)) { + deserializedFileShareUpdateProperties.provisionedThroughputMiBPerSec + = reader.getNullable(JsonReader::getInt); + } else if ("nfsProtocolProperties".equals(fieldName)) { + deserializedFileShareUpdateProperties.nfsProtocolProperties + = NfsProtocolProperties.fromJson(reader); + } else if ("publicAccessProperties".equals(fieldName)) { + deserializedFileShareUpdateProperties.publicAccessProperties + = PublicAccessProperties.fromJson(reader); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedFileShareUpdateProperties.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareUpdateProperties; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUsageDataOutput.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUsageDataOutput.java new file mode 100644 index 000000000000..a0d8d1667771 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUsageDataOutput.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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; + +/** + * File shares usage result. + */ +@Immutable +public final class FileShareUsageDataOutput implements JsonSerializable { + /* + * File share usage data for active file shares. + */ + private LiveSharesUsageData liveShares; + + /** + * Creates an instance of FileShareUsageDataOutput class. + */ + private FileShareUsageDataOutput() { + } + + /** + * Get the liveShares property: File share usage data for active file shares. + * + * @return the liveShares value. + */ + public LiveSharesUsageData liveShares() { + return this.liveShares; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("liveShares", this.liveShares); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareUsageDataOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareUsageDataOutput 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 FileShareUsageDataOutput. + */ + public static FileShareUsageDataOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareUsageDataOutput deserializedFileShareUsageDataOutput = new FileShareUsageDataOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("liveShares".equals(fieldName)) { + deserializedFileShareUsageDataOutput.liveShares = LiveSharesUsageData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareUsageDataOutput; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUsageDataResponse.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUsageDataResponse.java new file mode 100644 index 000000000000..d568deea9524 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUsageDataResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.resourcemanager.fileshares.fluent.models.FileShareUsageDataResponseInner; + +/** + * An immutable client-side representation of FileShareUsageDataResponse. + */ +public interface FileShareUsageDataResponse { + /** + * Gets the properties property: The properties of the file share usage data. + * + * @return the properties value. + */ + FileShareUsageDataOutput properties(); + + /** + * Gets the inner com.azure.resourcemanager.fileshares.fluent.models.FileShareUsageDataResponseInner object. + * + * @return the inner object. + */ + FileShareUsageDataResponseInner innerModel(); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShares.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShares.java new file mode 100644 index 000000000000..0dd27209a31f --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/FileShares.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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 FileShares. + */ +public interface FileShares { + /** + * Get a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FileShare along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, Context context); + + /** + * Get a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FileShare. + */ + FileShare getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Delete a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceName); + + /** + * Delete a FileShare. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceName, Context context); + + /** + * List FileShare resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a FileShare list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List FileShare resources by subscription 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 response of a FileShare list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List FileShare resources by 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 response of a FileShare list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List FileShare resources by 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 response of a FileShare list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Implements local CheckNameAvailability operations. + * + * @param location The name of the Azure region. + * @param body The CheckAvailability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the check availability result along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse(String location, + CheckNameAvailabilityRequest body, Context context); + + /** + * Implements local CheckNameAvailability operations. + * + * @param location The name of the Azure region. + * @param body The CheckAvailability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the check availability result. + */ + CheckNameAvailabilityResponse checkNameAvailability(String location, CheckNameAvailabilityRequest body); + + /** + * Get a FileShare. + * + * @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 a FileShare along with {@link Response}. + */ + FileShare getById(String id); + + /** + * Get a FileShare. + * + * @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 a FileShare along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a FileShare. + * + * @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 a FileShare. + * + * @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 FileShare resource. + * + * @param name resource name. + * @return the first stage of the new FileShare definition. + */ + FileShare.DefinitionStages.Blank define(String name); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/InformationalOperations.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/InformationalOperations.java new file mode 100644 index 000000000000..1beae7a4f0c0 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/InformationalOperations.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of InformationalOperations. + */ +public interface InformationalOperations { + /** + * Get file shares usage data. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares usage data along with {@link Response}. + */ + Response getUsageDataWithResponse(String location, Context context); + + /** + * Get file shares usage data. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares usage data. + */ + FileShareUsageDataResponse getUsageData(String location); + + /** + * Get file shares limits. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares limits along with {@link Response}. + */ + Response getLimitsWithResponse(String location, Context context); + + /** + * Get file shares limits. + * + * @param location The name of the Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares limits. + */ + FileShareLimitsResponse getLimits(String location); + + /** + * Get file shares provisioning parameters recommendation. + * + * @param location The name of the Azure region. + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares provisioning parameters recommendation along with {@link Response}. + */ + Response getProvisioningRecommendationWithResponse(String location, + FileShareProvisioningRecommendationRequest body, Context context); + + /** + * Get file shares provisioning parameters recommendation. + * + * @param location The name of the Azure region. + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return file shares provisioning parameters recommendation. + */ + FileShareProvisioningRecommendationResponse getProvisioningRecommendation(String location, + FileShareProvisioningRecommendationRequest body); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/LiveSharesUsageData.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/LiveSharesUsageData.java new file mode 100644 index 000000000000..d8be2dbe54eb --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/LiveSharesUsageData.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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; + +/** + * Usage data for live shares. + */ +@Immutable +public final class LiveSharesUsageData implements JsonSerializable { + /* + * The number of active file shares. + */ + private int fileShareCount; + + /** + * Creates an instance of LiveSharesUsageData class. + */ + private LiveSharesUsageData() { + } + + /** + * Get the fileShareCount property: The number of active file shares. + * + * @return the fileShareCount value. + */ + public int fileShareCount() { + return this.fileShareCount; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("fileShareCount", this.fileShareCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LiveSharesUsageData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LiveSharesUsageData 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 LiveSharesUsageData. + */ + public static LiveSharesUsageData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LiveSharesUsageData deserializedLiveSharesUsageData = new LiveSharesUsageData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileShareCount".equals(fieldName)) { + deserializedLiveSharesUsageData.fileShareCount = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedLiveSharesUsageData; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/MediaTier.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/MediaTier.java new file mode 100644 index 000000000000..feeb21efc5d8 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/MediaTier.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Media Tier enum. + */ +public final class MediaTier extends ExpandableStringEnum { + /** + * SSD media tier. + */ + public static final MediaTier SSD = fromString("SSD"); + + /** + * Creates a new instance of MediaTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MediaTier() { + } + + /** + * Creates or finds a MediaTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding MediaTier. + */ + public static MediaTier fromString(String name) { + return fromString(name, MediaTier.class); + } + + /** + * Gets known MediaTier values. + * + * @return known MediaTier values. + */ + public static Collection values() { + return values(MediaTier.class); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/NfsProtocolProperties.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/NfsProtocolProperties.java new file mode 100644 index 000000000000..6ce9deed1901 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/NfsProtocolProperties.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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; + +/** + * Properties specific to the NFS protocol. + */ +@Fluent +public final class NfsProtocolProperties implements JsonSerializable { + /* + * Root squash defines how root users on clients are mapped to the NFS share. + */ + private ShareRootSquash rootSquash; + + /* + * Encryption in transit defines whether data is encrypted for NFS shares. + */ + private EncryptionInTransitRequired encryptionInTransitRequired; + + /** + * Creates an instance of NfsProtocolProperties class. + */ + public NfsProtocolProperties() { + } + + /** + * Get the rootSquash property: Root squash defines how root users on clients are mapped to the NFS share. + * + * @return the rootSquash value. + */ + public ShareRootSquash rootSquash() { + return this.rootSquash; + } + + /** + * Set the rootSquash property: Root squash defines how root users on clients are mapped to the NFS share. + * + * @param rootSquash the rootSquash value to set. + * @return the NfsProtocolProperties object itself. + */ + public NfsProtocolProperties withRootSquash(ShareRootSquash rootSquash) { + this.rootSquash = rootSquash; + return this; + } + + /** + * Get the encryptionInTransitRequired property: Encryption in transit defines whether data is encrypted for NFS + * shares. + * + * @return the encryptionInTransitRequired value. + */ + public EncryptionInTransitRequired encryptionInTransitRequired() { + return this.encryptionInTransitRequired; + } + + /** + * Set the encryptionInTransitRequired property: Encryption in transit defines whether data is encrypted for NFS + * shares. + * + * @param encryptionInTransitRequired the encryptionInTransitRequired value to set. + * @return the NfsProtocolProperties object itself. + */ + public NfsProtocolProperties + withEncryptionInTransitRequired(EncryptionInTransitRequired encryptionInTransitRequired) { + this.encryptionInTransitRequired = encryptionInTransitRequired; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("rootSquash", this.rootSquash == null ? null : this.rootSquash.toString()); + jsonWriter.writeStringField("encryptionInTransitRequired", + this.encryptionInTransitRequired == null ? null : this.encryptionInTransitRequired.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NfsProtocolProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NfsProtocolProperties 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 NfsProtocolProperties. + */ + public static NfsProtocolProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NfsProtocolProperties deserializedNfsProtocolProperties = new NfsProtocolProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rootSquash".equals(fieldName)) { + deserializedNfsProtocolProperties.rootSquash = ShareRootSquash.fromString(reader.getString()); + } else if ("encryptionInTransitRequired".equals(fieldName)) { + deserializedNfsProtocolProperties.encryptionInTransitRequired + = EncryptionInTransitRequired.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNfsProtocolProperties; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/Operation.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/Operation.java new file mode 100644 index 000000000000..e1dbcfa5ca2d --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.resourcemanager.fileshares.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.fileshares.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/OperationDisplay.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/OperationDisplay.java new file mode 100644 index 000000000000..8c96ce7e8d8b --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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; + +/** + * Localized display information for an operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + private OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * {@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/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/Operations.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/Operations.java new file mode 100644 index 000000000000..1b021a7eb099 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.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 REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/Origin.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/Origin.java new file mode 100644 index 000000000000..a2ab782390a1 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpoint.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpoint.java new file mode 100644 index 000000000000..c72295b67940 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpoint.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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 resource identifier of the private endpoint + */ + private String id; + + /** + * Creates an instance of PrivateEndpoint class. + */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The resource identifier of the private endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * {@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/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnection.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnection.java new file mode 100644 index 000000000000..32e06db7b457 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnection.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.fileshares.fluent.models.PrivateEndpointConnectionInner; + +/** + * An immutable client-side representation of PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Resource properties. + * + * @return the properties value. + */ + PrivateEndpointConnectionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.fileshares.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, resourceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure + * Resource Manager. + * @return the next definition stage. + */ + WithCreate withExistingFileShare(String resourceGroupName, String resourceName); + } + + /** + * 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.WithProperties { + /** + * 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 properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Resource properties.. + * + * @param properties Resource properties. + * @return the next definition stage. + */ + WithCreate withProperties(PrivateEndpointConnectionProperties properties); + } + } + + /** + * 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/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnectionProperties.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..1fb385c05c41 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + 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/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnectionProvisioningState.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 000000000000..14c91fe595bb --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current provisioning state. + */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** + * Connection has been provisioned. + */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Connection is being created. + */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** + * Connection is being deleted. + */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** + * Connection provisioning has failed. + */ + 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/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnections.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnections.java new file mode 100644 index 000000000000..7ee83c43b68e --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnections.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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 { + /** + * Gets the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 file share along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String resourceName, + String privateEndpointConnectionName, Context context); + + /** + * Gets the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 file share. + */ + PrivateEndpointConnection get(String resourceGroupName, String resourceName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 resourceName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @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 resourceName, String privateEndpointConnectionName, Context context); + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PrivateEndpointConnection List as paginated response with {@link PagedIterable}. + */ + PagedIterable listByFileShare(String resourceGroupName, String resourceName); + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PrivateEndpointConnection List as paginated response with {@link PagedIterable}. + */ + PagedIterable listByFileShare(String resourceGroupName, String resourceName, + Context context); + + /** + * Gets the specified private endpoint connection associated with the file share. + * + * @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 file share along with {@link Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets the specified private endpoint connection associated with the file share. + * + * @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 file share along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified private endpoint connection associated with the file share. + * + * @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 file share. + * + * @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/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointServiceConnectionStatus.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 000000000000..fc58792a34cc --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The private endpoint connection status. + */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** + * Connection waiting for approval or rejection. + */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** + * Connection approved. + */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** + * Connection Rejected. + */ + 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/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkResource.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkResource.java new file mode 100644 index 000000000000..3b94cb57f0bd --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkResource.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.fileshares.fluent.models.PrivateLinkResourceInner; + +/** + * 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 properties property: Resource properties. + * + * @return the properties value. + */ + PrivateLinkResourceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.fileshares.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkResourceProperties.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..45f860378977 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkResourceProperties.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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.List; + +/** + * Properties of a private link resource. + */ +@Immutable +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. + */ + private 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + 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/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkResources.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkResources.java new file mode 100644 index 000000000000..4337eb22fd21 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkResources.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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 { + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a file share along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String resourceName, + String privateLinkResourceName, Context context); + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a file share. + */ + PrivateLinkResource get(String resourceGroupName, String resourceName, String privateLinkResourceName); + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resources that need to be created for a file share as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * Gets the private link resources that need to be created for a file share. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The resource name of the file share, as seen by the administrator through Azure Resource + * Manager. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 resources that need to be created for a file share as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkServiceConnectionState.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..0dbef635a34a --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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; + } + + /** + * {@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/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/Protocol.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/Protocol.java new file mode 100644 index 000000000000..e1ab569a5801 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/Protocol.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Protocol enum. + */ +public final class Protocol extends ExpandableStringEnum { + /** + * NFS protocol. + */ + public static final Protocol NFS = fromString("NFS"); + + /** + * Creates a new instance of Protocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Protocol() { + } + + /** + * Creates or finds a Protocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding Protocol. + */ + public static Protocol fromString(String name) { + return fromString(name, Protocol.class); + } + + /** + * Gets known Protocol values. + * + * @return known Protocol values. + */ + public static Collection values() { + return values(Protocol.class); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PublicAccessProperties.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PublicAccessProperties.java new file mode 100644 index 000000000000..a91f48d49f5c --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PublicAccessProperties.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.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; + +/** + * The set of properties for control public access. + */ +@Fluent +public final class PublicAccessProperties implements JsonSerializable { + /* + * The allowed set of subnets when access is restricted. + */ + private List allowedSubnets; + + /** + * Creates an instance of PublicAccessProperties class. + */ + public PublicAccessProperties() { + } + + /** + * Get the allowedSubnets property: The allowed set of subnets when access is restricted. + * + * @return the allowedSubnets value. + */ + public List allowedSubnets() { + return this.allowedSubnets; + } + + /** + * Set the allowedSubnets property: The allowed set of subnets when access is restricted. + * + * @param allowedSubnets the allowedSubnets value to set. + * @return the PublicAccessProperties object itself. + */ + public PublicAccessProperties withAllowedSubnets(List allowedSubnets) { + this.allowedSubnets = allowedSubnets; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("allowedSubnets", this.allowedSubnets, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicAccessProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicAccessProperties 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 PublicAccessProperties. + */ + public static PublicAccessProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicAccessProperties deserializedPublicAccessProperties = new PublicAccessProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowedSubnets".equals(fieldName)) { + List allowedSubnets = reader.readArray(reader1 -> reader1.getString()); + deserializedPublicAccessProperties.allowedSubnets = allowedSubnets; + } else { + reader.skipChildren(); + } + } + + return deserializedPublicAccessProperties; + }); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PublicNetworkAccess.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PublicNetworkAccess.java new file mode 100644 index 000000000000..8d96085c1311 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/PublicNetworkAccess.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * State of the public network access. + */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** + * The public network access is enabled. + */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** + * The public network access is disabled. + */ + 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/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/Redundancy.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/Redundancy.java new file mode 100644 index 000000000000..d4d96649e010 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/Redundancy.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Redundancy enum. + */ +public final class Redundancy extends ExpandableStringEnum { + /** + * Local redundancy. + */ + public static final Redundancy LOCAL = fromString("Local"); + + /** + * Zone redundancy. + */ + public static final Redundancy ZONE = fromString("Zone"); + + /** + * Creates a new instance of Redundancy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Redundancy() { + } + + /** + * Creates or finds a Redundancy from its string representation. + * + * @param name a name to look for. + * @return the corresponding Redundancy. + */ + public static Redundancy fromString(String name) { + return fromString(name, Redundancy.class); + } + + /** + * Gets known Redundancy values. + * + * @return known Redundancy values. + */ + public static Collection values() { + return values(Redundancy.class); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/ShareRootSquash.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/ShareRootSquash.java new file mode 100644 index 000000000000..0cd39839daa5 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/ShareRootSquash.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Share root squash enum. + */ +public final class ShareRootSquash extends ExpandableStringEnum { + /** + * No root squash. + */ + public static final ShareRootSquash NO_ROOT_SQUASH = fromString("NoRootSquash"); + + /** + * Root squash. + */ + public static final ShareRootSquash ROOT_SQUASH = fromString("RootSquash"); + + /** + * All squash. + */ + public static final ShareRootSquash ALL_SQUASH = fromString("AllSquash"); + + /** + * Creates a new instance of ShareRootSquash value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ShareRootSquash() { + } + + /** + * Creates or finds a ShareRootSquash from its string representation. + * + * @param name a name to look for. + * @return the corresponding ShareRootSquash. + */ + public static ShareRootSquash fromString(String name) { + return fromString(name, ShareRootSquash.class); + } + + /** + * Gets known ShareRootSquash values. + * + * @return known ShareRootSquash values. + */ + public static Collection values() { + return values(ShareRootSquash.class); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/package-info.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/models/package-info.java new file mode 100644 index 000000000000..020cca9f13da --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/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) TypeSpec Code Generator. + +/** + * Package containing the data models for FilesharesManagementClient. + * Azure File Shares Resource Provider API. + */ +package com.azure.resourcemanager.fileshares.models; diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/package-info.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/package-info.java new file mode 100644 index 000000000000..34ec8a047ea7 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/com/azure/resourcemanager/fileshares/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for FilesharesManagementClient. + * Azure File Shares Resource Provider API. + */ +package com.azure.resourcemanager.fileshares; diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/module-info.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/module-info.java new file mode 100644 index 000000000000..37d9dc64e7eb --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/java/module-info.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.resourcemanager.fileshares { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.fileshares; + exports com.azure.resourcemanager.fileshares.fluent; + exports com.azure.resourcemanager.fileshares.fluent.models; + exports com.azure.resourcemanager.fileshares.models; + + opens com.azure.resourcemanager.fileshares.fluent.models to com.azure.core; + opens com.azure.resourcemanager.fileshares.models to com.azure.core; + opens com.azure.resourcemanager.fileshares.implementation.models to com.azure.core; +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/resources/META-INF/azure-resourcemanager-fileshares_metadata.json b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/resources/META-INF/azure-resourcemanager-fileshares_metadata.json new file mode 100644 index 000000000000..1a51e6d83c6a --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/resources/META-INF/azure-resourcemanager-fileshares_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.FileShares":"2026-06-01"},"crossLanguageDefinitions":{"com.azure.resourcemanager.fileshares.fluent.FileShareSnapshotsClient":"Microsoft.FileShares.FileShareSnapshots","com.azure.resourcemanager.fileshares.fluent.FileShareSnapshotsClient.beginCreateOrUpdateFileShareSnapshot":"Microsoft.FileShares.FileShareSnapshots.createOrUpdateFileShareSnapshot","com.azure.resourcemanager.fileshares.fluent.FileShareSnapshotsClient.beginDeleteFileShareSnapshot":"Microsoft.FileShares.FileShareSnapshots.deleteFileShareSnapshot","com.azure.resourcemanager.fileshares.fluent.FileShareSnapshotsClient.beginUpdateFileShareSnapshot":"Microsoft.FileShares.FileShareSnapshots.updateFileShareSnapshot","com.azure.resourcemanager.fileshares.fluent.FileShareSnapshotsClient.createOrUpdateFileShareSnapshot":"Microsoft.FileShares.FileShareSnapshots.createOrUpdateFileShareSnapshot","com.azure.resourcemanager.fileshares.fluent.FileShareSnapshotsClient.deleteFileShareSnapshot":"Microsoft.FileShares.FileShareSnapshots.deleteFileShareSnapshot","com.azure.resourcemanager.fileshares.fluent.FileShareSnapshotsClient.getFileShareSnapshot":"Microsoft.FileShares.FileShareSnapshots.getFileShareSnapshot","com.azure.resourcemanager.fileshares.fluent.FileShareSnapshotsClient.getFileShareSnapshotWithResponse":"Microsoft.FileShares.FileShareSnapshots.getFileShareSnapshot","com.azure.resourcemanager.fileshares.fluent.FileShareSnapshotsClient.listByFileShare":"Microsoft.FileShares.FileShareSnapshots.listByFileShare","com.azure.resourcemanager.fileshares.fluent.FileShareSnapshotsClient.updateFileShareSnapshot":"Microsoft.FileShares.FileShareSnapshots.updateFileShareSnapshot","com.azure.resourcemanager.fileshares.fluent.FileSharesClient":"Microsoft.FileShares.FileShares","com.azure.resourcemanager.fileshares.fluent.FileSharesClient.beginCreateOrUpdate":"Microsoft.FileShares.FileShares.createOrUpdate","com.azure.resourcemanager.fileshares.fluent.FileSharesClient.beginDelete":"Microsoft.FileShares.FileShares.delete","com.azure.resourcemanager.fileshares.fluent.FileSharesClient.beginUpdate":"Microsoft.FileShares.FileShares.update","com.azure.resourcemanager.fileshares.fluent.FileSharesClient.checkNameAvailability":"Microsoft.FileShares.FileShares.checkNameAvailability","com.azure.resourcemanager.fileshares.fluent.FileSharesClient.checkNameAvailabilityWithResponse":"Microsoft.FileShares.FileShares.checkNameAvailability","com.azure.resourcemanager.fileshares.fluent.FileSharesClient.createOrUpdate":"Microsoft.FileShares.FileShares.createOrUpdate","com.azure.resourcemanager.fileshares.fluent.FileSharesClient.delete":"Microsoft.FileShares.FileShares.delete","com.azure.resourcemanager.fileshares.fluent.FileSharesClient.getByResourceGroup":"Microsoft.FileShares.FileShares.get","com.azure.resourcemanager.fileshares.fluent.FileSharesClient.getByResourceGroupWithResponse":"Microsoft.FileShares.FileShares.get","com.azure.resourcemanager.fileshares.fluent.FileSharesClient.list":"Microsoft.FileShares.FileShares.listBySubscription","com.azure.resourcemanager.fileshares.fluent.FileSharesClient.listByResourceGroup":"Microsoft.FileShares.FileShares.listByParent","com.azure.resourcemanager.fileshares.fluent.FileSharesClient.update":"Microsoft.FileShares.FileShares.update","com.azure.resourcemanager.fileshares.fluent.FileSharesManagementClient":"Microsoft.FileShares","com.azure.resourcemanager.fileshares.fluent.InformationalOperationsClient":"Microsoft.FileShares.InformationalOperations","com.azure.resourcemanager.fileshares.fluent.InformationalOperationsClient.getLimits":"Microsoft.FileShares.InformationalOperations.getLimits","com.azure.resourcemanager.fileshares.fluent.InformationalOperationsClient.getLimitsWithResponse":"Microsoft.FileShares.InformationalOperations.getLimits","com.azure.resourcemanager.fileshares.fluent.InformationalOperationsClient.getProvisioningRecommendation":"Microsoft.FileShares.InformationalOperations.getProvisioningRecommendation","com.azure.resourcemanager.fileshares.fluent.InformationalOperationsClient.getProvisioningRecommendationWithResponse":"Microsoft.FileShares.InformationalOperations.getProvisioningRecommendation","com.azure.resourcemanager.fileshares.fluent.InformationalOperationsClient.getUsageData":"Microsoft.FileShares.InformationalOperations.getUsageData","com.azure.resourcemanager.fileshares.fluent.InformationalOperationsClient.getUsageDataWithResponse":"Microsoft.FileShares.InformationalOperations.getUsageData","com.azure.resourcemanager.fileshares.fluent.OperationsClient":"Microsoft.FileShares.Operations","com.azure.resourcemanager.fileshares.fluent.OperationsClient.list":"Microsoft.FileShares.Operations.list","com.azure.resourcemanager.fileshares.fluent.PrivateEndpointConnectionsClient":"Microsoft.FileShares.PrivateEndpointConnections","com.azure.resourcemanager.fileshares.fluent.PrivateEndpointConnectionsClient.beginCreate":"Microsoft.FileShares.PrivateEndpointConnections.create","com.azure.resourcemanager.fileshares.fluent.PrivateEndpointConnectionsClient.beginDelete":"Microsoft.FileShares.PrivateEndpointConnections.delete","com.azure.resourcemanager.fileshares.fluent.PrivateEndpointConnectionsClient.create":"Microsoft.FileShares.PrivateEndpointConnections.create","com.azure.resourcemanager.fileshares.fluent.PrivateEndpointConnectionsClient.delete":"Microsoft.FileShares.PrivateEndpointConnections.delete","com.azure.resourcemanager.fileshares.fluent.PrivateEndpointConnectionsClient.get":"Microsoft.FileShares.PrivateEndpointConnections.get","com.azure.resourcemanager.fileshares.fluent.PrivateEndpointConnectionsClient.getWithResponse":"Microsoft.FileShares.PrivateEndpointConnections.get","com.azure.resourcemanager.fileshares.fluent.PrivateEndpointConnectionsClient.listByFileShare":"Microsoft.FileShares.PrivateEndpointConnections.listByFileShare","com.azure.resourcemanager.fileshares.fluent.PrivateLinkResourcesClient":"Microsoft.FileShares.PrivateLinkResources","com.azure.resourcemanager.fileshares.fluent.PrivateLinkResourcesClient.get":"Microsoft.FileShares.PrivateLinkResources.get","com.azure.resourcemanager.fileshares.fluent.PrivateLinkResourcesClient.getWithResponse":"Microsoft.FileShares.PrivateLinkResources.get","com.azure.resourcemanager.fileshares.fluent.PrivateLinkResourcesClient.list":"Microsoft.FileShares.PrivateLinkResources.list","com.azure.resourcemanager.fileshares.fluent.models.CheckNameAvailabilityResponseInner":"Azure.ResourceManager.CommonTypes.CheckNameAvailabilityResponse","com.azure.resourcemanager.fileshares.fluent.models.FileShareInner":"Microsoft.FileShares.FileShare","com.azure.resourcemanager.fileshares.fluent.models.FileShareLimitsResponseInner":"Microsoft.FileShares.FileShareLimitsResponse","com.azure.resourcemanager.fileshares.fluent.models.FileShareProvisioningRecommendationResponseInner":"Microsoft.FileShares.FileShareProvisioningRecommendationResponse","com.azure.resourcemanager.fileshares.fluent.models.FileShareSnapshotInner":"Microsoft.FileShares.FileShareSnapshot","com.azure.resourcemanager.fileshares.fluent.models.FileShareUsageDataResponseInner":"Microsoft.FileShares.FileShareUsageDataResponse","com.azure.resourcemanager.fileshares.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.fileshares.fluent.models.PrivateEndpointConnectionInner":"Microsoft.FileShares.PrivateEndpointConnection","com.azure.resourcemanager.fileshares.fluent.models.PrivateLinkResourceInner":"Microsoft.FileShares.PrivateLinkResource","com.azure.resourcemanager.fileshares.implementation.FileSharesManagementClientBuilder":"Microsoft.FileShares","com.azure.resourcemanager.fileshares.implementation.models.FileShareListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.fileshares.implementation.models.FileShareSnapshotListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.fileshares.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.fileshares.implementation.models.PrivateEndpointConnectionListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.fileshares.implementation.models.PrivateLinkResourceListResult":"Microsoft.FileShares.PrivateLinkResourceListResult","com.azure.resourcemanager.fileshares.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.fileshares.models.CheckNameAvailabilityReason":"Azure.ResourceManager.CommonTypes.CheckNameAvailabilityReason","com.azure.resourcemanager.fileshares.models.CheckNameAvailabilityRequest":"Azure.ResourceManager.CommonTypes.CheckNameAvailabilityRequest","com.azure.resourcemanager.fileshares.models.EncryptionInTransitRequired":"Microsoft.FileShares.EncryptionInTransitRequired","com.azure.resourcemanager.fileshares.models.FileShareLimits":"Microsoft.FileShares.FileShareLimits","com.azure.resourcemanager.fileshares.models.FileShareLimitsOutput":"Microsoft.FileShares.FileShareLimitsOutput","com.azure.resourcemanager.fileshares.models.FileShareProperties":"Microsoft.FileShares.FileShareProperties","com.azure.resourcemanager.fileshares.models.FileShareProvisioningConstants":"Microsoft.FileShares.FileShareProvisioningConstants","com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationInput":"Microsoft.FileShares.FileShareProvisioningRecommendationInput","com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationOutput":"Microsoft.FileShares.FileShareProvisioningRecommendationOutput","com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationRequest":"Microsoft.FileShares.FileShareProvisioningRecommendationRequest","com.azure.resourcemanager.fileshares.models.FileShareProvisioningState":"Microsoft.FileShares.FileShareProvisioningState","com.azure.resourcemanager.fileshares.models.FileShareSnapshotProperties":"Microsoft.FileShares.FileShareSnapshotProperties","com.azure.resourcemanager.fileshares.models.FileShareSnapshotUpdate":"Azure.ResourceManager.Foundations.ResourceUpdateModel","com.azure.resourcemanager.fileshares.models.FileShareSnapshotUpdateProperties":"Azure.ResourceManager.Foundations.ResourceUpdateModelProperties","com.azure.resourcemanager.fileshares.models.FileShareUpdate":"Azure.ResourceManager.Foundations.ResourceUpdateModel","com.azure.resourcemanager.fileshares.models.FileShareUpdateProperties":"Azure.ResourceManager.Foundations.ResourceUpdateModelProperties","com.azure.resourcemanager.fileshares.models.FileShareUsageDataOutput":"Microsoft.FileShares.FileShareUsageDataOutput","com.azure.resourcemanager.fileshares.models.LiveSharesUsageData":"Microsoft.FileShares.LiveSharesUsageData","com.azure.resourcemanager.fileshares.models.MediaTier":"Microsoft.FileShares.MediaTier","com.azure.resourcemanager.fileshares.models.NfsProtocolProperties":"Microsoft.FileShares.NfsProtocolProperties","com.azure.resourcemanager.fileshares.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.fileshares.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.fileshares.models.PrivateEndpoint":"Azure.ResourceManager.CommonTypes.PrivateEndpoint","com.azure.resourcemanager.fileshares.models.PrivateEndpointConnectionProperties":"Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties","com.azure.resourcemanager.fileshares.models.PrivateEndpointConnectionProvisioningState":"Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState","com.azure.resourcemanager.fileshares.models.PrivateEndpointServiceConnectionStatus":"Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus","com.azure.resourcemanager.fileshares.models.PrivateLinkResourceProperties":"Microsoft.FileShares.PrivateLinkResourceProperties","com.azure.resourcemanager.fileshares.models.PrivateLinkServiceConnectionState":"Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState","com.azure.resourcemanager.fileshares.models.Protocol":"Microsoft.FileShares.Protocol","com.azure.resourcemanager.fileshares.models.PublicAccessProperties":"Microsoft.FileShares.PublicAccessProperties","com.azure.resourcemanager.fileshares.models.PublicNetworkAccess":"Microsoft.FileShares.PublicNetworkAccess","com.azure.resourcemanager.fileshares.models.Redundancy":"Microsoft.FileShares.Redundancy","com.azure.resourcemanager.fileshares.models.ShareRootSquash":"Microsoft.FileShares.ShareRootSquash"},"generatedFiles":["src/main/java/com/azure/resourcemanager/fileshares/FilesharesManager.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/FileShareSnapshotsClient.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/FileSharesClient.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/FileSharesManagementClient.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/InformationalOperationsClient.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/PrivateEndpointConnectionsClient.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/PrivateLinkResourcesClient.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/models/CheckNameAvailabilityResponseInner.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareInner.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareLimitsResponseInner.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareProvisioningRecommendationResponseInner.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareSnapshotInner.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/models/FileShareUsageDataResponseInner.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/models/PrivateEndpointConnectionInner.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/models/PrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/fileshares/fluent/package-info.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/CheckNameAvailabilityResponseImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareLimitsResponseImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareProvisioningRecommendationResponseImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareSnapshotImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareSnapshotsClientImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareSnapshotsImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/FileShareUsageDataResponseImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesClientImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/FileSharesManagementClientImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/InformationalOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/InformationalOperationsImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateEndpointConnectionImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateEndpointConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateEndpointConnectionsImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateLinkResourceImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateLinkResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/PrivateLinkResourcesImpl.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/models/FileShareListResult.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/models/FileShareSnapshotListResult.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/models/PrivateEndpointConnectionListResult.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/models/PrivateLinkResourceListResult.java","src/main/java/com/azure/resourcemanager/fileshares/implementation/package-info.java","src/main/java/com/azure/resourcemanager/fileshares/models/ActionType.java","src/main/java/com/azure/resourcemanager/fileshares/models/CheckNameAvailabilityReason.java","src/main/java/com/azure/resourcemanager/fileshares/models/CheckNameAvailabilityRequest.java","src/main/java/com/azure/resourcemanager/fileshares/models/CheckNameAvailabilityResponse.java","src/main/java/com/azure/resourcemanager/fileshares/models/EncryptionInTransitRequired.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShare.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareLimits.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareLimitsOutput.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareLimitsResponse.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProperties.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningConstants.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationInput.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationOutput.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationRequest.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningRecommendationResponse.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareProvisioningState.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshot.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshotProperties.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshotUpdate.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshotUpdateProperties.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareSnapshots.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUpdate.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUpdateProperties.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUsageDataOutput.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShareUsageDataResponse.java","src/main/java/com/azure/resourcemanager/fileshares/models/FileShares.java","src/main/java/com/azure/resourcemanager/fileshares/models/InformationalOperations.java","src/main/java/com/azure/resourcemanager/fileshares/models/LiveSharesUsageData.java","src/main/java/com/azure/resourcemanager/fileshares/models/MediaTier.java","src/main/java/com/azure/resourcemanager/fileshares/models/NfsProtocolProperties.java","src/main/java/com/azure/resourcemanager/fileshares/models/Operation.java","src/main/java/com/azure/resourcemanager/fileshares/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/fileshares/models/Operations.java","src/main/java/com/azure/resourcemanager/fileshares/models/Origin.java","src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpoint.java","src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnection.java","src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnectionProvisioningState.java","src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointConnections.java","src/main/java/com/azure/resourcemanager/fileshares/models/PrivateEndpointServiceConnectionStatus.java","src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkResource.java","src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkResources.java","src/main/java/com/azure/resourcemanager/fileshares/models/PrivateLinkServiceConnectionState.java","src/main/java/com/azure/resourcemanager/fileshares/models/Protocol.java","src/main/java/com/azure/resourcemanager/fileshares/models/PublicAccessProperties.java","src/main/java/com/azure/resourcemanager/fileshares/models/PublicNetworkAccess.java","src/main/java/com/azure/resourcemanager/fileshares/models/Redundancy.java","src/main/java/com/azure/resourcemanager/fileshares/models/ShareRootSquash.java","src/main/java/com/azure/resourcemanager/fileshares/models/package-info.java","src/main/java/com/azure/resourcemanager/fileshares/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-fileshares/proxy-config.json b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-fileshares/proxy-config.json new file mode 100644 index 000000000000..84685670f892 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-fileshares/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.fileshares.implementation.FileShareSnapshotsClientImpl$FileShareSnapshotsService"],["com.azure.resourcemanager.fileshares.implementation.FileSharesClientImpl$FileSharesService"],["com.azure.resourcemanager.fileshares.implementation.InformationalOperationsClientImpl$InformationalOperationsService"],["com.azure.resourcemanager.fileshares.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.fileshares.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.fileshares.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"]] \ No newline at end of file diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-fileshares/reflect-config.json b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-fileshares/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-fileshares/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/main/resources/azure-resourcemanager-fileshares.properties b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/resources/azure-resourcemanager-fileshares.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/main/resources/azure-resourcemanager-fileshares.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsCreateOrUpdateFileShareSnapshotSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsCreateOrUpdateFileShareSnapshotSamples.java new file mode 100644 index 000000000000..c6d65394b461 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsCreateOrUpdateFileShareSnapshotSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.resourcemanager.fileshares.models.FileShareSnapshotProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FileShareSnapshots CreateOrUpdateFileShareSnapshot. + */ +public final class FileShareSnapshotsCreateOrUpdateFileShareSnapshotSamples { + /* + * x-ms-original-file: 2026-06-01/FileShareSnapshot_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: FileShareSnapshot_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileShareSnapshotCreateOrUpdateMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShareSnapshots() + .define("testfilesharesnapshot") + .withExistingFileShare("rgfileshares", "fileshare") + .withProperties(new FileShareSnapshotProperties().withInitiatorId("backup-vault-001") + .withMetadata(mapOf("key9372", "fakeTokenPlaceholder"))) + .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/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsDeleteFileShareSnapshotSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsDeleteFileShareSnapshotSamples.java new file mode 100644 index 000000000000..d8b5d53d72c8 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsDeleteFileShareSnapshotSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +/** + * Samples for FileShareSnapshots DeleteFileShareSnapshot. + */ +public final class FileShareSnapshotsDeleteFileShareSnapshotSamples { + /* + * x-ms-original-file: 2026-06-01/FileShareSnapshot_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: FileShareSnapshot_Delete_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileShareSnapshotDeleteMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShareSnapshots() + .deleteFileShareSnapshot("rgfileshares", "fileshare", "testfilesharesnapshot", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsGetFileShareSnapshotSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsGetFileShareSnapshotSamples.java new file mode 100644 index 000000000000..345d78cae9f4 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsGetFileShareSnapshotSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +/** + * Samples for FileShareSnapshots GetFileShareSnapshot. + */ +public final class FileShareSnapshotsGetFileShareSnapshotSamples { + /* + * x-ms-original-file: 2026-06-01/FileShareSnapshot_Get_MaximumSet_Gen.json + */ + /** + * Sample code: FileShareSnapshot_Get_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareSnapshotGetMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShareSnapshots() + .getFileShareSnapshotWithResponse("rgfileshares", "fileshare", "testfilesharesnapshot", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsListByFileShareSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsListByFileShareSamples.java new file mode 100644 index 000000000000..515bf832b39e --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsListByFileShareSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +/** + * Samples for FileShareSnapshots ListByFileShare. + */ +public final class FileShareSnapshotsListByFileShareSamples { + /* + * x-ms-original-file: 2026-06-01/FileShareSnapshot_List_MinimumSet_Gen.json + */ + /** + * Sample code: FileShareSnapshot_List_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareSnapshotListMinimumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShareSnapshots().listByFileShare("rgfileshares", "testfileshare", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/FileShareSnapshot_List_MaximumSet_Gen.json + */ + /** + * Sample code: FileShareSnapshot_List_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareSnapshotListMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShareSnapshots().listByFileShare("rgfileshares", "fileshare", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsUpdateFileShareSnapshotSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsUpdateFileShareSnapshotSamples.java new file mode 100644 index 000000000000..bbe0361cb814 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsUpdateFileShareSnapshotSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.resourcemanager.fileshares.models.FileShareSnapshot; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshotUpdateProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FileShareSnapshots UpdateFileShareSnapshot. + */ +public final class FileShareSnapshotsUpdateFileShareSnapshotSamples { + /* + * x-ms-original-file: 2026-06-01/FileShareSnapshot_Update_MaximumSet_Gen.json + */ + /** + * Sample code: FileShareSnapshot_Update_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileShareSnapshotUpdateMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + FileShareSnapshot resource = manager.fileShareSnapshots() + .getFileShareSnapshotWithResponse("rgfileshares", "fileshare", "testfilesharesnapshot", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties( + new FileShareSnapshotUpdateProperties().withMetadata(mapOf("key491", "fakeTokenPlaceholder"))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesCheckNameAvailabilitySamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesCheckNameAvailabilitySamples.java new file mode 100644 index 000000000000..e23f6a729a42 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesCheckNameAvailabilitySamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.resourcemanager.fileshares.models.CheckNameAvailabilityRequest; + +/** + * Samples for FileShares CheckNameAvailability. + */ +public final class FileSharesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: 2026-06-01/FileShares_CheckNameAvailability_MaximumSet_Gen.json + */ + /** + * Sample code: FileShares_CheckNameAvailability_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileSharesCheckNameAvailabilityMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares() + .checkNameAvailabilityWithResponse("westus", + new CheckNameAvailabilityRequest().withName("fvykqbgmd").withType("Microsoft.FileShares/fileShares"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/FileShares_CheckNameAvailability_MinimumSet_Gen.json + */ + /** + * Sample code: FileShares_CheckNameAvailability_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileSharesCheckNameAvailabilityMinimumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares() + .checkNameAvailabilityWithResponse("westus", new CheckNameAvailabilityRequest(), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesCreateOrUpdateSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..827b61c03a95 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesCreateOrUpdateSamples.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.resourcemanager.fileshares.models.EncryptionInTransitRequired; +import com.azure.resourcemanager.fileshares.models.FileShareProperties; +import com.azure.resourcemanager.fileshares.models.MediaTier; +import com.azure.resourcemanager.fileshares.models.NfsProtocolProperties; +import com.azure.resourcemanager.fileshares.models.Protocol; +import com.azure.resourcemanager.fileshares.models.PublicAccessProperties; +import com.azure.resourcemanager.fileshares.models.PublicNetworkAccess; +import com.azure.resourcemanager.fileshares.models.Redundancy; +import com.azure.resourcemanager.fileshares.models.ShareRootSquash; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FileShares CreateOrUpdate. + */ +public final class FileSharesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-06-01/FileShares_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: FileShares_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileSharesCreateOrUpdateMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares() + .define("fileshare") + .withRegion("westus") + .withExistingResourceGroup("rgfileshares") + .withTags(mapOf("key9647", "fakeTokenPlaceholder")) + .withProperties(new FileShareProperties().withMountName("fileshare") + .withMediaTier(MediaTier.SSD) + .withRedundancy(Redundancy.LOCAL) + .withProtocol(Protocol.NFS) + .withProvisionedStorageGiB(8) + .withProvisionedIOPerSec(5) + .withProvisionedThroughputMiBPerSec(22) + .withNfsProtocolProperties(new NfsProtocolProperties().withRootSquash(ShareRootSquash.NO_ROOT_SQUASH) + .withEncryptionInTransitRequired(EncryptionInTransitRequired.ENABLED)) + .withPublicAccessProperties(new PublicAccessProperties().withAllowedSubnets(Arrays.asList( + "/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"))) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesDeleteSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesDeleteSamples.java new file mode 100644 index 000000000000..a607697128ec --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +/** + * Samples for FileShares Delete. + */ +public final class FileSharesDeleteSamples { + /* + * x-ms-original-file: 2026-06-01/FileShares_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: FileShares_Delete_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileSharesDeleteMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares().delete("rgfileshares", "fileshare", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesGetByResourceGroupSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..bfe8b8c44efe --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +/** + * Samples for FileShares GetByResourceGroup. + */ +public final class FileSharesGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-06-01/FileShares_Get_MaximumSet_Gen.json + */ + /** + * Sample code: FileShares_Get_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileSharesGetMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares() + .getByResourceGroupWithResponse("rgfileshares", "fileshare", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesListByResourceGroupSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesListByResourceGroupSamples.java new file mode 100644 index 000000000000..1c3e40e023ef --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesListByResourceGroupSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +/** + * Samples for FileShares ListByResourceGroup. + */ +public final class FileSharesListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-06-01/FileShares_ListByParent_MinimumSet_Gen.json + */ + /** + * Sample code: FileShares_ListByParent_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileSharesListByParentMinimumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares().listByResourceGroup("rgfileshares", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/FileShares_ListByParent_MaximumSet_Gen.json + */ + /** + * Sample code: FileShares_ListByParent_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileSharesListByParentMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares().listByResourceGroup("rgfileshares", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesListSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesListSamples.java new file mode 100644 index 000000000000..5d421d57cf68 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesListSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +/** + * Samples for FileShares List. + */ +public final class FileSharesListSamples { + /* + * x-ms-original-file: 2026-06-01/FileShares_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: FileShares_ListBySubscription_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileSharesListBySubscriptionMinimumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/FileShares_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: FileShares_ListBySubscription_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + fileSharesListBySubscriptionMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.fileShares().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesUpdateSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesUpdateSamples.java new file mode 100644 index 000000000000..7bf70d05c4d1 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/FileSharesUpdateSamples.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.resourcemanager.fileshares.models.EncryptionInTransitRequired; +import com.azure.resourcemanager.fileshares.models.FileShare; +import com.azure.resourcemanager.fileshares.models.FileShareUpdateProperties; +import com.azure.resourcemanager.fileshares.models.NfsProtocolProperties; +import com.azure.resourcemanager.fileshares.models.PublicAccessProperties; +import com.azure.resourcemanager.fileshares.models.PublicNetworkAccess; +import com.azure.resourcemanager.fileshares.models.ShareRootSquash; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for FileShares Update. + */ +public final class FileSharesUpdateSamples { + /* + * x-ms-original-file: 2026-06-01/FileShares_Update_MaximumSet_Gen.json + */ + /** + * Sample code: FileShares_Update_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileSharesUpdateMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + FileShare resource = manager.fileShares() + .getByResourceGroupWithResponse("rgfileshares", "fileshare", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key173", "fakeTokenPlaceholder")) + .withProperties(new FileShareUpdateProperties().withProvisionedStorageGiB(7) + .withProvisionedIOPerSec(1) + .withProvisionedThroughputMiBPerSec(29) + .withNfsProtocolProperties(new NfsProtocolProperties().withRootSquash(ShareRootSquash.NO_ROOT_SQUASH) + .withEncryptionInTransitRequired(EncryptionInTransitRequired.ENABLED)) + .withPublicAccessProperties(new PublicAccessProperties().withAllowedSubnets(Arrays.asList( + "/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"))) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED)) + .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/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetLimitsSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetLimitsSamples.java new file mode 100644 index 000000000000..75131b42a113 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetLimitsSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +/** + * Samples for InformationalOperations GetLimits. + */ +public final class InformationalOperationsGetLimitsSamples { + /* + * x-ms-original-file: 2026-06-01/FileShare_GetLimits_MinimumSet_Gen.json + */ + /** + * Sample code: FileShare_GetLimits_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareGetLimitsMinimumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.informationalOperations().getLimitsWithResponse("westus", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/FileShare_GetLimits_MaximumSet_Gen.json + */ + /** + * Sample code: FileShare_GetLimits_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareGetLimitsMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.informationalOperations().getLimitsWithResponse("westus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetProvisioningRecommendationSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetProvisioningRecommendationSamples.java new file mode 100644 index 000000000000..1bca4e24d345 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetProvisioningRecommendationSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationInput; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationRequest; + +/** + * Samples for InformationalOperations GetProvisioningRecommendation. + */ +public final class InformationalOperationsGetProvisioningRecommendationSamples { + /* + * x-ms-original-file: 2026-06-01/FileShare_GetProvisioningRecommendation_MaximumSet_Gen.json + */ + /** + * Sample code: FileShare_GetProvisioningRecommendation_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareGetProvisioningRecommendationMaximumSet( + com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.informationalOperations() + .getProvisioningRecommendationWithResponse("westus", + new FileShareProvisioningRecommendationRequest() + .withProperties(new FileShareProvisioningRecommendationInput().withProvisionedStorageGiB(7)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/FileShare_GetProvisioningRecommendation_MinimumSet_Gen.json + */ + /** + * Sample code: FileShare_GetProvisioningRecommendation_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareGetProvisioningRecommendationMinimumSet( + com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.informationalOperations() + .getProvisioningRecommendationWithResponse("westus", + new FileShareProvisioningRecommendationRequest() + .withProperties(new FileShareProvisioningRecommendationInput().withProvisionedStorageGiB(7)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetUsageDataSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetUsageDataSamples.java new file mode 100644 index 000000000000..321a43397786 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetUsageDataSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +/** + * Samples for InformationalOperations GetUsageData. + */ +public final class InformationalOperationsGetUsageDataSamples { + /* + * x-ms-original-file: 2026-06-01/FileShare_GetUsageData_MaximumSet_Gen.json + */ + /** + * Sample code: FileShare_GetUsageData_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareGetUsageDataMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.informationalOperations().getUsageDataWithResponse("westus", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/FileShare_GetUsageData_MinimumSet_Gen.json + */ + /** + * Sample code: FileShare_GetUsageData_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void fileShareGetUsageDataMinimumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.informationalOperations().getUsageDataWithResponse("westus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/OperationsListSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/OperationsListSamples.java new file mode 100644 index 000000000000..c3884abdc875 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/OperationsListSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-06-01/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void operationsListMinimumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-06-01/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet. + * + * @param manager Entry point to FilesharesManager. + */ + public static void operationsListMaximumSet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsCreateSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsCreateSamples.java new file mode 100644 index 000000000000..51858d633167 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsCreateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.resourcemanager.fileshares.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.fileshares.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections Create. + */ +public final class PrivateEndpointConnectionsCreateSamples { + /* + * x-ms-original-file: 2026-06-01/PrivateEndpointConnections_Create.json + */ + /** + * Sample code: PrivateEndpointConnections_Create. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + privateEndpointConnectionsCreate(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.privateEndpointConnections() + .define("privateEndpointConnection1") + .withExistingFileShare("rgfileshares", "fileshare") + .withProperties(new PrivateEndpointConnectionProperties().withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by admin"))) + .create(); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..ddd9e1763ae2 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: 2026-06-01/PrivateEndpointConnections_Delete.json + */ + /** + * Sample code: PrivateEndpointConnections_Delete. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + privateEndpointConnectionsDelete(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.privateEndpointConnections() + .delete("rgfileshares", "fileshare", "privateEndpointConnection1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..ec7a6ba01366 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: 2026-06-01/PrivateEndpointConnections_Get.json + */ + /** + * Sample code: PrivateEndpointConnections_Get. + * + * @param manager Entry point to FilesharesManager. + */ + public static void privateEndpointConnectionsGet(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.privateEndpointConnections() + .getWithResponse("rgfileshares", "fileshare", "privateEndpointConnection1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsListByFileShareSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsListByFileShareSamples.java new file mode 100644 index 000000000000..9faf41228717 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsListByFileShareSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +/** + * Samples for PrivateEndpointConnections ListByFileShare. + */ +public final class PrivateEndpointConnectionsListByFileShareSamples { + /* + * x-ms-original-file: 2026-06-01/PrivateEndpointConnections_ListByFileShare.json + */ + /** + * Sample code: PrivateEndpointConnections_ListByFileShare. + * + * @param manager Entry point to FilesharesManager. + */ + public static void + privateEndpointConnectionsListByFileShare(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.privateEndpointConnections() + .listByFileShare("rgfileshares", "fileshare", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourcesGetSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourcesGetSamples.java new file mode 100644 index 000000000000..d600b4c84d51 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourcesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +/** + * Samples for PrivateLinkResources Get. + */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: 2026-06-01/PrivateLinkResources_Get.json + */ + /** + * Sample code: Get PrivateLinkResource. + * + * @param manager Entry point to FilesharesManager. + */ + public static void getPrivateLinkResource(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.privateLinkResources() + .getWithResponse("res4303", "testfileshare01", "fileshare", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourcesListSamples.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourcesListSamples.java new file mode 100644 index 000000000000..80bdbdc0529e --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/samples/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourcesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +/** + * Samples for PrivateLinkResources List. + */ +public final class PrivateLinkResourcesListSamples { + /* + * x-ms-original-file: 2026-06-01/PrivateLinkResources_ListByFileShare.json + */ + /** + * Sample code: List PrivateLinkResources. + * + * @param manager Entry point to FilesharesManager. + */ + public static void listPrivateLinkResources(com.azure.resourcemanager.fileshares.FilesharesManager manager) { + manager.privateLinkResources().list("res4303", "testfileshare01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/CheckNameAvailabilityRequestTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/CheckNameAvailabilityRequestTests.java new file mode 100644 index 000000000000..4ea77ec0cf35 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/CheckNameAvailabilityRequestTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.CheckNameAvailabilityRequest; +import org.junit.jupiter.api.Assertions; + +public final class CheckNameAvailabilityRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CheckNameAvailabilityRequest model + = BinaryData.fromString("{\"name\":\"w\",\"type\":\"m\"}").toObject(CheckNameAvailabilityRequest.class); + Assertions.assertEquals("w", model.name()); + Assertions.assertEquals("m", model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CheckNameAvailabilityRequest model = new CheckNameAvailabilityRequest().withName("w").withType("m"); + model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityRequest.class); + Assertions.assertEquals("w", model.name()); + Assertions.assertEquals("m", model.type()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/CheckNameAvailabilityResponseInnerTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/CheckNameAvailabilityResponseInnerTests.java new file mode 100644 index 000000000000..62ce390de674 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/CheckNameAvailabilityResponseInnerTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.fluent.models.CheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.fileshares.models.CheckNameAvailabilityReason; +import org.junit.jupiter.api.Assertions; + +public final class CheckNameAvailabilityResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CheckNameAvailabilityResponseInner model + = BinaryData.fromString("{\"nameAvailable\":true,\"reason\":\"Invalid\",\"message\":\"yvvtpgvdfgio\"}") + .toObject(CheckNameAvailabilityResponseInner.class); + Assertions.assertTrue(model.nameAvailable()); + Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, model.reason()); + Assertions.assertEquals("yvvtpgvdfgio", model.message()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareInnerTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareInnerTests.java new file mode 100644 index 000000000000..8aaace04fcae --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareInnerTests.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareInner; +import com.azure.resourcemanager.fileshares.models.EncryptionInTransitRequired; +import com.azure.resourcemanager.fileshares.models.FileShareProperties; +import com.azure.resourcemanager.fileshares.models.MediaTier; +import com.azure.resourcemanager.fileshares.models.NfsProtocolProperties; +import com.azure.resourcemanager.fileshares.models.Protocol; +import com.azure.resourcemanager.fileshares.models.PublicAccessProperties; +import com.azure.resourcemanager.fileshares.models.PublicNetworkAccess; +import com.azure.resourcemanager.fileshares.models.Redundancy; +import com.azure.resourcemanager.fileshares.models.ShareRootSquash; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class FileShareInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareInner model = BinaryData.fromString( + "{\"properties\":{\"mountName\":\"hq\",\"hostName\":\"gjxpybczmehmt\",\"mediaTier\":\"SSD\",\"redundancy\":\"Zone\",\"protocol\":\"NFS\",\"provisionedStorageGiB\":594038518,\"provisionedStorageNextAllowedDowngrade\":\"2021-05-31T07:59:53Z\",\"provisionedIOPerSec\":182731623,\"provisionedIOPerSecNextAllowedDowngrade\":\"2021-04-26T13:22:48Z\",\"provisionedThroughputMiBPerSec\":1332019186,\"provisionedThroughputNextAllowedDowngrade\":\"2021-04-19T05:48:54Z\",\"includedBurstIOPerSec\":318397575,\"maxBurstIOPerSecCredits\":7862936344800210145,\"nfsProtocolProperties\":{\"rootSquash\":\"RootSquash\",\"encryptionInTransitRequired\":\"Enabled\"},\"publicAccessProperties\":{\"allowedSubnets\":[\"dxbmtqioq\",\"zehtbmu\",\"p\"]},\"provisioningState\":\"Patching\",\"publicNetworkAccess\":\"Enabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"xybqsoqij\",\"k\"],\"privateEndpoint\":{\"id\":\"pazlobcufpdz\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"cqqjnqglhqgn\",\"actionsRequired\":\"ooojywifsqe\"},\"provisioningState\":\"Deleting\"},\"id\":\"dfmglzlhjx\",\"name\":\"ifkwmrvktsizntoc\",\"type\":\"pa\"},{\"properties\":{\"groupIds\":[\"psqucmpoyf\"],\"privateEndpoint\":{\"id\":\"ogknygjofjdd\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"deupewnwrei\",\"actionsRequired\":\"zyf\"},\"provisioningState\":\"Creating\"},\"id\":\"rh\",\"name\":\"ofcqhsm\",\"type\":\"urkdtmlx\"}]},\"location\":\"kuksjtxukcdm\",\"tags\":{\"w\":\"cryuan\",\"pmrqobm\":\"xzdxtayrlhmwh\",\"knryrtihfxtij\":\"u\",\"zk\":\"pzvgnwzsymglzufc\"},\"id\":\"hdbihan\",\"name\":\"fhfcb\",\"type\":\"y\"}") + .toObject(FileShareInner.class); + Assertions.assertEquals("kuksjtxukcdm", model.location()); + Assertions.assertEquals("cryuan", model.tags().get("w")); + Assertions.assertEquals("hq", model.properties().mountName()); + Assertions.assertEquals(MediaTier.SSD, model.properties().mediaTier()); + Assertions.assertEquals(Redundancy.ZONE, model.properties().redundancy()); + Assertions.assertEquals(Protocol.NFS, model.properties().protocol()); + Assertions.assertEquals(594038518, model.properties().provisionedStorageGiB()); + Assertions.assertEquals(182731623, model.properties().provisionedIOPerSec()); + Assertions.assertEquals(1332019186, model.properties().provisionedThroughputMiBPerSec()); + Assertions.assertEquals(ShareRootSquash.ROOT_SQUASH, model.properties().nfsProtocolProperties().rootSquash()); + Assertions.assertEquals(EncryptionInTransitRequired.ENABLED, + model.properties().nfsProtocolProperties().encryptionInTransitRequired()); + Assertions.assertEquals("dxbmtqioq", model.properties().publicAccessProperties().allowedSubnets().get(0)); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.properties().publicNetworkAccess()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FileShareInner model = new FileShareInner().withLocation("kuksjtxukcdm") + .withTags(mapOf("w", "cryuan", "pmrqobm", "xzdxtayrlhmwh", "knryrtihfxtij", "u", "zk", "pzvgnwzsymglzufc")) + .withProperties(new FileShareProperties().withMountName("hq") + .withMediaTier(MediaTier.SSD) + .withRedundancy(Redundancy.ZONE) + .withProtocol(Protocol.NFS) + .withProvisionedStorageGiB(594038518) + .withProvisionedIOPerSec(182731623) + .withProvisionedThroughputMiBPerSec(1332019186) + .withNfsProtocolProperties(new NfsProtocolProperties().withRootSquash(ShareRootSquash.ROOT_SQUASH) + .withEncryptionInTransitRequired(EncryptionInTransitRequired.ENABLED)) + .withPublicAccessProperties( + new PublicAccessProperties().withAllowedSubnets(Arrays.asList("dxbmtqioq", "zehtbmu", "p"))) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED)); + model = BinaryData.fromObject(model).toObject(FileShareInner.class); + Assertions.assertEquals("kuksjtxukcdm", model.location()); + Assertions.assertEquals("cryuan", model.tags().get("w")); + Assertions.assertEquals("hq", model.properties().mountName()); + Assertions.assertEquals(MediaTier.SSD, model.properties().mediaTier()); + Assertions.assertEquals(Redundancy.ZONE, model.properties().redundancy()); + Assertions.assertEquals(Protocol.NFS, model.properties().protocol()); + Assertions.assertEquals(594038518, model.properties().provisionedStorageGiB()); + Assertions.assertEquals(182731623, model.properties().provisionedIOPerSec()); + Assertions.assertEquals(1332019186, model.properties().provisionedThroughputMiBPerSec()); + Assertions.assertEquals(ShareRootSquash.ROOT_SQUASH, model.properties().nfsProtocolProperties().rootSquash()); + Assertions.assertEquals(EncryptionInTransitRequired.ENABLED, + model.properties().nfsProtocolProperties().encryptionInTransitRequired()); + Assertions.assertEquals("dxbmtqioq", model.properties().publicAccessProperties().allowedSubnets().get(0)); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.properties().publicNetworkAccess()); + } + + // 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/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareLimitsOutputTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareLimitsOutputTests.java new file mode 100644 index 000000000000..f119b914a382 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareLimitsOutputTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.FileShareLimitsOutput; +import org.junit.jupiter.api.Assertions; + +public final class FileShareLimitsOutputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareLimitsOutput model = BinaryData.fromString( + "{\"limits\":{\"maxFileShares\":1785940860,\"maxFileShareSnapshots\":1778259828,\"maxFileShareSubnets\":1882721753,\"maxFileSharePrivateEndpointConnections\":1485053733,\"minProvisionedStorageGiB\":1421441668,\"maxProvisionedStorageGiB\":1772662038,\"minProvisionedIOPerSec\":100068665,\"maxProvisionedIOPerSec\":1783138805,\"minProvisionedThroughputMiBPerSec\":1932691851,\"maxProvisionedThroughputMiBPerSec\":2100121858},\"provisioningConstants\":{\"baseIOPerSec\":1196709774,\"scalarIOPerSec\":72.1345356002445,\"baseThroughputMiBPerSec\":1272670546,\"scalarThroughputMiBPerSec\":46.78969770766594,\"guardrailIOPerSecScalar\":29.805304047933355,\"guardrailThroughputScalar\":6.725331731598683}}") + .toObject(FileShareLimitsOutput.class); + Assertions.assertEquals(1785940860, model.limits().maxFileShares()); + Assertions.assertEquals(1778259828, model.limits().maxFileShareSnapshots()); + Assertions.assertEquals(1882721753, model.limits().maxFileShareSubnets()); + Assertions.assertEquals(1485053733, model.limits().maxFileSharePrivateEndpointConnections()); + Assertions.assertEquals(1421441668, model.limits().minProvisionedStorageGiB()); + Assertions.assertEquals(1772662038, model.limits().maxProvisionedStorageGiB()); + Assertions.assertEquals(100068665, model.limits().minProvisionedIOPerSec()); + Assertions.assertEquals(1783138805, model.limits().maxProvisionedIOPerSec()); + Assertions.assertEquals(1932691851, model.limits().minProvisionedThroughputMiBPerSec()); + Assertions.assertEquals(2100121858, model.limits().maxProvisionedThroughputMiBPerSec()); + Assertions.assertEquals(1196709774, model.provisioningConstants().baseIOPerSec()); + Assertions.assertEquals(72.1345356002445, model.provisioningConstants().scalarIOPerSec()); + Assertions.assertEquals(1272670546, model.provisioningConstants().baseThroughputMiBPerSec()); + Assertions.assertEquals(46.78969770766594, model.provisioningConstants().scalarThroughputMiBPerSec()); + Assertions.assertEquals(29.805304047933355, model.provisioningConstants().guardrailIOPerSecScalar()); + Assertions.assertEquals(6.725331731598683, model.provisioningConstants().guardrailThroughputScalar()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareLimitsResponseInnerTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareLimitsResponseInnerTests.java new file mode 100644 index 000000000000..69814cbb5263 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareLimitsResponseInnerTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareLimitsResponseInner; +import org.junit.jupiter.api.Assertions; + +public final class FileShareLimitsResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareLimitsResponseInner model = BinaryData.fromString( + "{\"properties\":{\"limits\":{\"maxFileShares\":1493558591,\"maxFileShareSnapshots\":2143826704,\"maxFileShareSubnets\":1890498246,\"maxFileSharePrivateEndpointConnections\":2058649208,\"minProvisionedStorageGiB\":1309614398,\"maxProvisionedStorageGiB\":1414548234,\"minProvisionedIOPerSec\":1520989721,\"maxProvisionedIOPerSec\":1083545989,\"minProvisionedThroughputMiBPerSec\":223654021,\"maxProvisionedThroughputMiBPerSec\":299344741},\"provisioningConstants\":{\"baseIOPerSec\":306734530,\"scalarIOPerSec\":77.41510425361014,\"baseThroughputMiBPerSec\":445329815,\"scalarThroughputMiBPerSec\":82.09638916807184,\"guardrailIOPerSecScalar\":70.10904951109774,\"guardrailThroughputScalar\":51.84957148993339}}}") + .toObject(FileShareLimitsResponseInner.class); + Assertions.assertEquals(1493558591, model.properties().limits().maxFileShares()); + Assertions.assertEquals(2143826704, model.properties().limits().maxFileShareSnapshots()); + Assertions.assertEquals(1890498246, model.properties().limits().maxFileShareSubnets()); + Assertions.assertEquals(2058649208, model.properties().limits().maxFileSharePrivateEndpointConnections()); + Assertions.assertEquals(1309614398, model.properties().limits().minProvisionedStorageGiB()); + Assertions.assertEquals(1414548234, model.properties().limits().maxProvisionedStorageGiB()); + Assertions.assertEquals(1520989721, model.properties().limits().minProvisionedIOPerSec()); + Assertions.assertEquals(1083545989, model.properties().limits().maxProvisionedIOPerSec()); + Assertions.assertEquals(223654021, model.properties().limits().minProvisionedThroughputMiBPerSec()); + Assertions.assertEquals(299344741, model.properties().limits().maxProvisionedThroughputMiBPerSec()); + Assertions.assertEquals(306734530, model.properties().provisioningConstants().baseIOPerSec()); + Assertions.assertEquals(77.41510425361014, model.properties().provisioningConstants().scalarIOPerSec()); + Assertions.assertEquals(445329815, model.properties().provisioningConstants().baseThroughputMiBPerSec()); + Assertions.assertEquals(82.09638916807184, + model.properties().provisioningConstants().scalarThroughputMiBPerSec()); + Assertions.assertEquals(70.10904951109774, + model.properties().provisioningConstants().guardrailIOPerSecScalar()); + Assertions.assertEquals(51.84957148993339, + model.properties().provisioningConstants().guardrailThroughputScalar()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareLimitsTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareLimitsTests.java new file mode 100644 index 000000000000..3bf92ad984b4 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareLimitsTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.FileShareLimits; +import org.junit.jupiter.api.Assertions; + +public final class FileShareLimitsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareLimits model = BinaryData.fromString( + "{\"maxFileShares\":206207279,\"maxFileShareSnapshots\":178812834,\"maxFileShareSubnets\":306270503,\"maxFileSharePrivateEndpointConnections\":1423802799,\"minProvisionedStorageGiB\":681133133,\"maxProvisionedStorageGiB\":1044580515,\"minProvisionedIOPerSec\":1201119723,\"maxProvisionedIOPerSec\":812677705,\"minProvisionedThroughputMiBPerSec\":682758161,\"maxProvisionedThroughputMiBPerSec\":1925395217}") + .toObject(FileShareLimits.class); + Assertions.assertEquals(206207279, model.maxFileShares()); + Assertions.assertEquals(178812834, model.maxFileShareSnapshots()); + Assertions.assertEquals(306270503, model.maxFileShareSubnets()); + Assertions.assertEquals(1423802799, model.maxFileSharePrivateEndpointConnections()); + Assertions.assertEquals(681133133, model.minProvisionedStorageGiB()); + Assertions.assertEquals(1044580515, model.maxProvisionedStorageGiB()); + Assertions.assertEquals(1201119723, model.minProvisionedIOPerSec()); + Assertions.assertEquals(812677705, model.maxProvisionedIOPerSec()); + Assertions.assertEquals(682758161, model.minProvisionedThroughputMiBPerSec()); + Assertions.assertEquals(1925395217, model.maxProvisionedThroughputMiBPerSec()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareListResultTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareListResultTests.java new file mode 100644 index 000000000000..effd80fd2979 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareListResultTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.implementation.models.FileShareListResult; +import com.azure.resourcemanager.fileshares.models.EncryptionInTransitRequired; +import com.azure.resourcemanager.fileshares.models.MediaTier; +import com.azure.resourcemanager.fileshares.models.Protocol; +import com.azure.resourcemanager.fileshares.models.PublicNetworkAccess; +import com.azure.resourcemanager.fileshares.models.Redundancy; +import com.azure.resourcemanager.fileshares.models.ShareRootSquash; +import org.junit.jupiter.api.Assertions; + +public final class FileShareListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"mountName\":\"qfou\",\"hostName\":\"mmnkzsmodmgl\",\"mediaTier\":\"SSD\",\"redundancy\":\"Local\",\"protocol\":\"NFS\",\"provisionedStorageGiB\":542784283,\"provisionedStorageNextAllowedDowngrade\":\"2021-03-15T14:00:11Z\",\"provisionedIOPerSec\":1581209984,\"provisionedIOPerSecNextAllowedDowngrade\":\"2021-08-28T07:34:48Z\",\"provisionedThroughputMiBPerSec\":675008389,\"provisionedThroughputNextAllowedDowngrade\":\"2021-01-27T01:22:28Z\",\"includedBurstIOPerSec\":807711520,\"maxBurstIOPerSecCredits\":7210492425439546280,\"nfsProtocolProperties\":{\"rootSquash\":\"AllSquash\",\"encryptionInTransitRequired\":\"Enabled\"},\"publicAccessProperties\":{\"allowedSubnets\":[\"vqwhbmdgbbjfd\",\"gmbmbexppbh\",\"q\",\"rolfpfp\"]},\"provisioningState\":\"Updating\",\"publicNetworkAccess\":\"Enabled\",\"privateEndpointConnections\":[{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"gjyjgzjaoyfhrtxi\",\"name\":\"n\",\"type\":\"rkujy\"}]},\"location\":\"l\",\"tags\":{\"nwbxgjvtbvpyssz\":\"vfqawrlyxwjkcpr\",\"guhmuouqfpr\":\"nruj\",\"nguitnwuizgazxu\":\"zw\"},\"id\":\"izuckyfihrfidfvz\",\"name\":\"dzuhtymwi\",\"type\":\"dkfthwxmnt\"},{\"properties\":{\"mountName\":\"aop\",\"hostName\":\"mijcmmxdcufufs\",\"mediaTier\":\"SSD\",\"redundancy\":\"Zone\",\"protocol\":\"NFS\",\"provisionedStorageGiB\":1823460887,\"provisionedStorageNextAllowedDowngrade\":\"2021-10-23T08:25:02Z\",\"provisionedIOPerSec\":1219718844,\"provisionedIOPerSecNextAllowedDowngrade\":\"2021-01-22T02:13:35Z\",\"provisionedThroughputMiBPerSec\":391919190,\"provisionedThroughputNextAllowedDowngrade\":\"2021-04-17T07:41:34Z\",\"includedBurstIOPerSec\":121296393,\"maxBurstIOPerSecCredits\":2876654491928953392,\"nfsProtocolProperties\":{\"rootSquash\":\"NoRootSquash\",\"encryptionInTransitRequired\":\"Enabled\"},\"publicAccessProperties\":{\"allowedSubnets\":[\"iachbo\",\"sflnrosfqp\",\"eeh\",\"zvypyqrimzinp\"]},\"provisioningState\":\"TransientFailure\",\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"oodqxhcrm\",\"name\":\"ohjtckw\",\"type\":\"dsoifiyipj\"},{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"wpgrjbzno\",\"name\":\"cjxvsnbyxqab\",\"type\":\"mocpc\"},{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"urzafb\",\"name\":\"jjgpb\",\"type\":\"oq\"},{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"klj\",\"name\":\"vbqid\",\"type\":\"qajzyulpkudjkr\"}]},\"location\":\"hbzhfepg\",\"tags\":{\"zloc\":\"e\"},\"id\":\"scpai\",\"name\":\"rhhbcs\",\"type\":\"l\"},{\"properties\":{\"mountName\":\"a\",\"hostName\":\"j\",\"mediaTier\":\"SSD\",\"redundancy\":\"Zone\",\"protocol\":\"NFS\",\"provisionedStorageGiB\":1455975978,\"provisionedStorageNextAllowedDowngrade\":\"2021-01-04T07:19:33Z\",\"provisionedIOPerSec\":372100049,\"provisionedIOPerSecNextAllowedDowngrade\":\"2021-05-18T14:10:03Z\",\"provisionedThroughputMiBPerSec\":1684749712,\"provisionedThroughputNextAllowedDowngrade\":\"2021-01-11T15:15:23Z\",\"includedBurstIOPerSec\":1116116329,\"maxBurstIOPerSecCredits\":8132312778385746697,\"nfsProtocolProperties\":{\"rootSquash\":\"AllSquash\",\"encryptionInTransitRequired\":\"Disabled\"},\"publicAccessProperties\":{\"allowedSubnets\":[\"po\"]},\"provisioningState\":\"TransientFailure\",\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"djwzrlov\",\"name\":\"clwhijcoejctbz\",\"type\":\"qsqsy\"}]},\"location\":\"kbfkg\",\"tags\":{\"xaxcfjpgddtocjjx\":\"kexxppof\",\"eojnxqbzvddn\":\"vpmouexhdzxib\",\"aoqvuh\":\"wndeicbtwnp\"},\"id\":\"hcffcyddglmjthjq\",\"name\":\"wpyeicxmqciwqvh\",\"type\":\"hix\"}],\"nextLink\":\"gdtopbobjogh\"}") + .toObject(FileShareListResult.class); + Assertions.assertEquals("l", model.value().get(0).location()); + Assertions.assertEquals("vfqawrlyxwjkcpr", model.value().get(0).tags().get("nwbxgjvtbvpyssz")); + Assertions.assertEquals("qfou", model.value().get(0).properties().mountName()); + Assertions.assertEquals(MediaTier.SSD, model.value().get(0).properties().mediaTier()); + Assertions.assertEquals(Redundancy.LOCAL, model.value().get(0).properties().redundancy()); + Assertions.assertEquals(Protocol.NFS, model.value().get(0).properties().protocol()); + Assertions.assertEquals(542784283, model.value().get(0).properties().provisionedStorageGiB()); + Assertions.assertEquals(1581209984, model.value().get(0).properties().provisionedIOPerSec()); + Assertions.assertEquals(675008389, model.value().get(0).properties().provisionedThroughputMiBPerSec()); + Assertions.assertEquals(ShareRootSquash.ALL_SQUASH, + model.value().get(0).properties().nfsProtocolProperties().rootSquash()); + Assertions.assertEquals(EncryptionInTransitRequired.ENABLED, + model.value().get(0).properties().nfsProtocolProperties().encryptionInTransitRequired()); + Assertions.assertEquals("vqwhbmdgbbjfd", + model.value().get(0).properties().publicAccessProperties().allowedSubnets().get(0)); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).properties().publicNetworkAccess()); + Assertions.assertEquals("gdtopbobjogh", model.nextLink()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharePropertiesTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharePropertiesTests.java new file mode 100644 index 000000000000..07bb543ebe4e --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharePropertiesTests.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.EncryptionInTransitRequired; +import com.azure.resourcemanager.fileshares.models.FileShareProperties; +import com.azure.resourcemanager.fileshares.models.MediaTier; +import com.azure.resourcemanager.fileshares.models.NfsProtocolProperties; +import com.azure.resourcemanager.fileshares.models.Protocol; +import com.azure.resourcemanager.fileshares.models.PublicAccessProperties; +import com.azure.resourcemanager.fileshares.models.PublicNetworkAccess; +import com.azure.resourcemanager.fileshares.models.Redundancy; +import com.azure.resourcemanager.fileshares.models.ShareRootSquash; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class FileSharePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareProperties model = BinaryData.fromString( + "{\"mountName\":\"git\",\"hostName\":\"qhabifpikxwcz\",\"mediaTier\":\"SSD\",\"redundancy\":\"Local\",\"protocol\":\"NFS\",\"provisionedStorageGiB\":219984358,\"provisionedStorageNextAllowedDowngrade\":\"2021-08-14T16:42:07Z\",\"provisionedIOPerSec\":222313615,\"provisionedIOPerSecNextAllowedDowngrade\":\"2020-12-30T16:23:36Z\",\"provisionedThroughputMiBPerSec\":649847293,\"provisionedThroughputNextAllowedDowngrade\":\"2021-02-02T22:35:41Z\",\"includedBurstIOPerSec\":1753847734,\"maxBurstIOPerSecCredits\":3301538698074823511,\"nfsProtocolProperties\":{\"rootSquash\":\"RootSquash\",\"encryptionInTransitRequired\":\"Enabled\"},\"publicAccessProperties\":{\"allowedSubnets\":[\"wvukx\",\"audccsnhs\"]},\"provisioningState\":\"Succeeded\",\"publicNetworkAccess\":\"Enabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"htnapczwlokjyem\",\"kvnipjoxz\",\"nchgej\",\"podmailzydehojwy\"],\"privateEndpoint\":{\"id\":\"xinpmqnjaq\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"sprozvcput\",\"actionsRequired\":\"jvwmfda\"},\"provisioningState\":\"Succeeded\"},\"id\":\"dvpjhulsuuvmk\",\"name\":\"ozkrwfndiodjpslw\",\"type\":\"jdpvwryo\"},{\"properties\":{\"groupIds\":[\"acctazakljla\",\"bcryffdfd\"],\"privateEndpoint\":{\"id\":\"gexpaojakhmsbz\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"zevdphlx\",\"actionsRequired\":\"lthqtrgqjbp\"},\"provisioningState\":\"Failed\"},\"id\":\"inzgvfcj\",\"name\":\"wzo\",\"type\":\"xjtfelluwfzit\"}]}") + .toObject(FileShareProperties.class); + Assertions.assertEquals("git", model.mountName()); + Assertions.assertEquals(MediaTier.SSD, model.mediaTier()); + Assertions.assertEquals(Redundancy.LOCAL, model.redundancy()); + Assertions.assertEquals(Protocol.NFS, model.protocol()); + Assertions.assertEquals(219984358, model.provisionedStorageGiB()); + Assertions.assertEquals(222313615, model.provisionedIOPerSec()); + Assertions.assertEquals(649847293, model.provisionedThroughputMiBPerSec()); + Assertions.assertEquals(ShareRootSquash.ROOT_SQUASH, model.nfsProtocolProperties().rootSquash()); + Assertions.assertEquals(EncryptionInTransitRequired.ENABLED, + model.nfsProtocolProperties().encryptionInTransitRequired()); + Assertions.assertEquals("wvukx", model.publicAccessProperties().allowedSubnets().get(0)); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FileShareProperties model = new FileShareProperties().withMountName("git") + .withMediaTier(MediaTier.SSD) + .withRedundancy(Redundancy.LOCAL) + .withProtocol(Protocol.NFS) + .withProvisionedStorageGiB(219984358) + .withProvisionedIOPerSec(222313615) + .withProvisionedThroughputMiBPerSec(649847293) + .withNfsProtocolProperties(new NfsProtocolProperties().withRootSquash(ShareRootSquash.ROOT_SQUASH) + .withEncryptionInTransitRequired(EncryptionInTransitRequired.ENABLED)) + .withPublicAccessProperties( + new PublicAccessProperties().withAllowedSubnets(Arrays.asList("wvukx", "audccsnhs"))) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED); + model = BinaryData.fromObject(model).toObject(FileShareProperties.class); + Assertions.assertEquals("git", model.mountName()); + Assertions.assertEquals(MediaTier.SSD, model.mediaTier()); + Assertions.assertEquals(Redundancy.LOCAL, model.redundancy()); + Assertions.assertEquals(Protocol.NFS, model.protocol()); + Assertions.assertEquals(219984358, model.provisionedStorageGiB()); + Assertions.assertEquals(222313615, model.provisionedIOPerSec()); + Assertions.assertEquals(649847293, model.provisionedThroughputMiBPerSec()); + Assertions.assertEquals(ShareRootSquash.ROOT_SQUASH, model.nfsProtocolProperties().rootSquash()); + Assertions.assertEquals(EncryptionInTransitRequired.ENABLED, + model.nfsProtocolProperties().encryptionInTransitRequired()); + Assertions.assertEquals("wvukx", model.publicAccessProperties().allowedSubnets().get(0)); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareProvisioningConstantsTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareProvisioningConstantsTests.java new file mode 100644 index 000000000000..f0957dff8f37 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareProvisioningConstantsTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningConstants; +import org.junit.jupiter.api.Assertions; + +public final class FileShareProvisioningConstantsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareProvisioningConstants model = BinaryData.fromString( + "{\"baseIOPerSec\":1990259381,\"scalarIOPerSec\":33.20230783790736,\"baseThroughputMiBPerSec\":961118443,\"scalarThroughputMiBPerSec\":72.58622829423445,\"guardrailIOPerSecScalar\":22.407160322024012,\"guardrailThroughputScalar\":17.090889926292764}") + .toObject(FileShareProvisioningConstants.class); + Assertions.assertEquals(1990259381, model.baseIOPerSec()); + Assertions.assertEquals(33.20230783790736, model.scalarIOPerSec()); + Assertions.assertEquals(961118443, model.baseThroughputMiBPerSec()); + Assertions.assertEquals(72.58622829423445, model.scalarThroughputMiBPerSec()); + Assertions.assertEquals(22.407160322024012, model.guardrailIOPerSecScalar()); + Assertions.assertEquals(17.090889926292764, model.guardrailThroughputScalar()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareProvisioningRecommendationInputTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareProvisioningRecommendationInputTests.java new file mode 100644 index 000000000000..4b67c283b4ba --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareProvisioningRecommendationInputTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationInput; +import org.junit.jupiter.api.Assertions; + +public final class FileShareProvisioningRecommendationInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareProvisioningRecommendationInput model = BinaryData.fromString("{\"provisionedStorageGiB\":1877680716}") + .toObject(FileShareProvisioningRecommendationInput.class); + Assertions.assertEquals(1877680716, model.provisionedStorageGiB()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FileShareProvisioningRecommendationInput model + = new FileShareProvisioningRecommendationInput().withProvisionedStorageGiB(1877680716); + model = BinaryData.fromObject(model).toObject(FileShareProvisioningRecommendationInput.class); + Assertions.assertEquals(1877680716, model.provisionedStorageGiB()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareProvisioningRecommendationOutputTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareProvisioningRecommendationOutputTests.java new file mode 100644 index 000000000000..d963c8139240 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareProvisioningRecommendationOutputTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationOutput; +import com.azure.resourcemanager.fileshares.models.Redundancy; +import org.junit.jupiter.api.Assertions; + +public final class FileShareProvisioningRecommendationOutputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareProvisioningRecommendationOutput model = BinaryData.fromString( + "{\"provisionedIOPerSec\":1916962672,\"provisionedThroughputMiBPerSec\":1163138760,\"availableRedundancyOptions\":[\"Zone\"]}") + .toObject(FileShareProvisioningRecommendationOutput.class); + Assertions.assertEquals(1916962672, model.provisionedIOPerSec()); + Assertions.assertEquals(1163138760, model.provisionedThroughputMiBPerSec()); + Assertions.assertEquals(Redundancy.ZONE, model.availableRedundancyOptions().get(0)); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareProvisioningRecommendationRequestTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareProvisioningRecommendationRequestTests.java new file mode 100644 index 000000000000..b5f349bdfc40 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareProvisioningRecommendationRequestTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationInput; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationRequest; +import org.junit.jupiter.api.Assertions; + +public final class FileShareProvisioningRecommendationRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareProvisioningRecommendationRequest model + = BinaryData.fromString("{\"properties\":{\"provisionedStorageGiB\":1786560396}}") + .toObject(FileShareProvisioningRecommendationRequest.class); + Assertions.assertEquals(1786560396, model.properties().provisionedStorageGiB()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FileShareProvisioningRecommendationRequest model = new FileShareProvisioningRecommendationRequest() + .withProperties(new FileShareProvisioningRecommendationInput().withProvisionedStorageGiB(1786560396)); + model = BinaryData.fromObject(model).toObject(FileShareProvisioningRecommendationRequest.class); + Assertions.assertEquals(1786560396, model.properties().provisionedStorageGiB()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareProvisioningRecommendationResponseInnerTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareProvisioningRecommendationResponseInnerTests.java new file mode 100644 index 000000000000..515ba8ed6b67 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareProvisioningRecommendationResponseInnerTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareProvisioningRecommendationResponseInner; +import com.azure.resourcemanager.fileshares.models.Redundancy; +import org.junit.jupiter.api.Assertions; + +public final class FileShareProvisioningRecommendationResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareProvisioningRecommendationResponseInner model = BinaryData.fromString( + "{\"properties\":{\"provisionedIOPerSec\":2114864042,\"provisionedThroughputMiBPerSec\":1410521625,\"availableRedundancyOptions\":[\"Local\"]}}") + .toObject(FileShareProvisioningRecommendationResponseInner.class); + Assertions.assertEquals(2114864042, model.properties().provisionedIOPerSec()); + Assertions.assertEquals(1410521625, model.properties().provisionedThroughputMiBPerSec()); + Assertions.assertEquals(Redundancy.LOCAL, model.properties().availableRedundancyOptions().get(0)); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotInnerTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotInnerTests.java new file mode 100644 index 000000000000..ed142605fbeb --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotInnerTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareSnapshotInner; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshotProperties; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class FileShareSnapshotInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareSnapshotInner model = BinaryData.fromString( + "{\"properties\":{\"snapshotTime\":\"tutqxlngxlefgug\",\"initiatorId\":\"krxd\",\"metadata\":{\"hzrvqd\":\"dt\"}},\"id\":\"bhj\",\"name\":\"big\",\"type\":\"h\"}") + .toObject(FileShareSnapshotInner.class); + Assertions.assertEquals("krxd", model.properties().initiatorId()); + Assertions.assertEquals("dt", model.properties().metadata().get("hzrvqd")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FileShareSnapshotInner model = new FileShareSnapshotInner().withProperties( + new FileShareSnapshotProperties().withInitiatorId("krxd").withMetadata(mapOf("hzrvqd", "dt"))); + model = BinaryData.fromObject(model).toObject(FileShareSnapshotInner.class); + Assertions.assertEquals("krxd", model.properties().initiatorId()); + Assertions.assertEquals("dt", model.properties().metadata().get("hzrvqd")); + } + + // 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/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotListResultTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotListResultTests.java new file mode 100644 index 000000000000..e6e9c1576750 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotListResultTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.implementation.models.FileShareSnapshotListResult; +import org.junit.jupiter.api.Assertions; + +public final class FileShareSnapshotListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareSnapshotListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"snapshotTime\":\"ea\",\"initiatorId\":\"ipheoflokeyyien\",\"metadata\":{\"jumasx\":\"lwtgrhpdj\",\"qyeg\":\"zj\",\"hejjz\":\"alhbx\"}},\"id\":\"dudgwdslfhot\",\"name\":\"mcy\",\"type\":\"pwlbjnpg\"}],\"nextLink\":\"ftadehxnltyfs\"}") + .toObject(FileShareSnapshotListResult.class); + Assertions.assertEquals("ipheoflokeyyien", model.value().get(0).properties().initiatorId()); + Assertions.assertEquals("lwtgrhpdj", model.value().get(0).properties().metadata().get("jumasx")); + Assertions.assertEquals("ftadehxnltyfs", model.nextLink()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotPropertiesTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotPropertiesTests.java new file mode 100644 index 000000000000..4b4efde5ea2f --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotPropertiesTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshotProperties; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class FileShareSnapshotPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareSnapshotProperties model = BinaryData.fromString( + "{\"snapshotTime\":\"fbowskanyk\",\"initiatorId\":\"lcuiywgqywgndr\",\"metadata\":{\"fvm\":\"hzgpphrcgyncocpe\",\"bmqj\":\"coofsxlzev\",\"lzu\":\"abcypmivk\"}}") + .toObject(FileShareSnapshotProperties.class); + Assertions.assertEquals("lcuiywgqywgndr", model.initiatorId()); + Assertions.assertEquals("hzgpphrcgyncocpe", model.metadata().get("fvm")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FileShareSnapshotProperties model = new FileShareSnapshotProperties().withInitiatorId("lcuiywgqywgndr") + .withMetadata(mapOf("fvm", "hzgpphrcgyncocpe", "bmqj", "coofsxlzev", "lzu", "abcypmivk")); + model = BinaryData.fromObject(model).toObject(FileShareSnapshotProperties.class); + Assertions.assertEquals("lcuiywgqywgndr", model.initiatorId()); + Assertions.assertEquals("hzgpphrcgyncocpe", model.metadata().get("fvm")); + } + + // 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/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotUpdatePropertiesTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotUpdatePropertiesTests.java new file mode 100644 index 000000000000..71e8a0bbba27 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotUpdatePropertiesTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshotUpdateProperties; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class FileShareSnapshotUpdatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareSnapshotUpdateProperties model + = BinaryData.fromString("{\"metadata\":{\"ochcbonqvpkvl\":\"mngnzscxaqw\"}}") + .toObject(FileShareSnapshotUpdateProperties.class); + Assertions.assertEquals("mngnzscxaqw", model.metadata().get("ochcbonqvpkvl")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FileShareSnapshotUpdateProperties model + = new FileShareSnapshotUpdateProperties().withMetadata(mapOf("ochcbonqvpkvl", "mngnzscxaqw")); + model = BinaryData.fromObject(model).toObject(FileShareSnapshotUpdateProperties.class); + Assertions.assertEquals("mngnzscxaqw", model.metadata().get("ochcbonqvpkvl")); + } + + // 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/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotUpdateTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotUpdateTests.java new file mode 100644 index 000000000000..c377c1c09eb0 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotUpdateTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshotUpdate; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshotUpdateProperties; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class FileShareSnapshotUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareSnapshotUpdate model = BinaryData + .fromString( + "{\"properties\":{\"metadata\":{\"onlebxetqgtzxdpn\":\"wnfnbacf\",\"eallnwsubisnj\":\"bqqwxrj\"}}}") + .toObject(FileShareSnapshotUpdate.class); + Assertions.assertEquals("wnfnbacf", model.properties().metadata().get("onlebxetqgtzxdpn")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FileShareSnapshotUpdate model + = new FileShareSnapshotUpdate().withProperties(new FileShareSnapshotUpdateProperties() + .withMetadata(mapOf("onlebxetqgtzxdpn", "wnfnbacf", "eallnwsubisnj", "bqqwxrj"))); + model = BinaryData.fromObject(model).toObject(FileShareSnapshotUpdate.class); + Assertions.assertEquals("wnfnbacf", model.properties().metadata().get("onlebxetqgtzxdpn")); + } + + // 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/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsGetFileShareSnapshotWithResponseMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsGetFileShareSnapshotWithResponseMockTests.java new file mode 100644 index 000000000000..a64990b6df99 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsGetFileShareSnapshotWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshot; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FileShareSnapshotsGetFileShareSnapshotWithResponseMockTests { + @Test + public void testGetFileShareSnapshotWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"snapshotTime\":\"wiwubm\",\"initiatorId\":\"besldnkwwtppjflc\",\"metadata\":{\"mkqzeqqkdltfzxmh\":\"aokonzmnsik\",\"gureodkwobdag\":\"v\",\"gqxndlkzgxhuripl\":\"tibqdxbxwakb\",\"bxmubyynt\":\"podxunkb\"}},\"id\":\"rbqtkoie\",\"name\":\"seotgqrllt\",\"type\":\"u\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + FileShareSnapshot response = manager.fileShareSnapshots() + .getFileShareSnapshotWithResponse("emwabnet", "hhszh", "d", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("besldnkwwtppjflc", response.properties().initiatorId()); + Assertions.assertEquals("aokonzmnsik", response.properties().metadata().get("mkqzeqqkdltfzxmh")); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsListByFileShareMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsListByFileShareMockTests.java new file mode 100644 index 000000000000..6b52d30974da --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareSnapshotsListByFileShareMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.FileShareSnapshot; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FileShareSnapshotsListByFileShareMockTests { + @Test + public void testListByFileShare() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"snapshotTime\":\"nzbtbhj\",\"initiatorId\":\"lkfg\",\"metadata\":{\"ikdowwquuvx\":\"neuelfphsdyhtoz\"}},\"id\":\"clvit\",\"name\":\"hqzonosggbhcoh\",\"type\":\"wdsjnkalju\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.fileShareSnapshots() + .listByFileShare("lauwzizxbmpgcjef", "zmuvpbttdumorppx", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("lkfg", response.iterator().next().properties().initiatorId()); + Assertions.assertEquals("neuelfphsdyhtoz", + response.iterator().next().properties().metadata().get("ikdowwquuvx")); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareUpdatePropertiesTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareUpdatePropertiesTests.java new file mode 100644 index 000000000000..bd7ccc5c01d6 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareUpdatePropertiesTests.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.EncryptionInTransitRequired; +import com.azure.resourcemanager.fileshares.models.FileShareUpdateProperties; +import com.azure.resourcemanager.fileshares.models.NfsProtocolProperties; +import com.azure.resourcemanager.fileshares.models.PublicAccessProperties; +import com.azure.resourcemanager.fileshares.models.PublicNetworkAccess; +import com.azure.resourcemanager.fileshares.models.ShareRootSquash; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class FileShareUpdatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareUpdateProperties model = BinaryData.fromString( + "{\"provisionedStorageGiB\":1048772360,\"provisionedIOPerSec\":248766473,\"provisionedThroughputMiBPerSec\":754447097,\"nfsProtocolProperties\":{\"rootSquash\":\"AllSquash\",\"encryptionInTransitRequired\":\"Enabled\"},\"publicAccessProperties\":{\"allowedSubnets\":[\"nqgoulzndli\",\"wyqkgfgibm\",\"dgak\",\"qsrxybzqqed\"]},\"publicNetworkAccess\":\"Disabled\"}") + .toObject(FileShareUpdateProperties.class); + Assertions.assertEquals(1048772360, model.provisionedStorageGiB()); + Assertions.assertEquals(248766473, model.provisionedIOPerSec()); + Assertions.assertEquals(754447097, model.provisionedThroughputMiBPerSec()); + Assertions.assertEquals(ShareRootSquash.ALL_SQUASH, model.nfsProtocolProperties().rootSquash()); + Assertions.assertEquals(EncryptionInTransitRequired.ENABLED, + model.nfsProtocolProperties().encryptionInTransitRequired()); + Assertions.assertEquals("nqgoulzndli", model.publicAccessProperties().allowedSubnets().get(0)); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FileShareUpdateProperties model = new FileShareUpdateProperties().withProvisionedStorageGiB(1048772360) + .withProvisionedIOPerSec(248766473) + .withProvisionedThroughputMiBPerSec(754447097) + .withNfsProtocolProperties(new NfsProtocolProperties().withRootSquash(ShareRootSquash.ALL_SQUASH) + .withEncryptionInTransitRequired(EncryptionInTransitRequired.ENABLED)) + .withPublicAccessProperties(new PublicAccessProperties() + .withAllowedSubnets(Arrays.asList("nqgoulzndli", "wyqkgfgibm", "dgak", "qsrxybzqqed"))) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED); + model = BinaryData.fromObject(model).toObject(FileShareUpdateProperties.class); + Assertions.assertEquals(1048772360, model.provisionedStorageGiB()); + Assertions.assertEquals(248766473, model.provisionedIOPerSec()); + Assertions.assertEquals(754447097, model.provisionedThroughputMiBPerSec()); + Assertions.assertEquals(ShareRootSquash.ALL_SQUASH, model.nfsProtocolProperties().rootSquash()); + Assertions.assertEquals(EncryptionInTransitRequired.ENABLED, + model.nfsProtocolProperties().encryptionInTransitRequired()); + Assertions.assertEquals("nqgoulzndli", model.publicAccessProperties().allowedSubnets().get(0)); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareUpdateTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareUpdateTests.java new file mode 100644 index 000000000000..cd2bbb108d2d --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareUpdateTests.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.EncryptionInTransitRequired; +import com.azure.resourcemanager.fileshares.models.FileShareUpdate; +import com.azure.resourcemanager.fileshares.models.FileShareUpdateProperties; +import com.azure.resourcemanager.fileshares.models.NfsProtocolProperties; +import com.azure.resourcemanager.fileshares.models.PublicAccessProperties; +import com.azure.resourcemanager.fileshares.models.PublicNetworkAccess; +import com.azure.resourcemanager.fileshares.models.ShareRootSquash; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class FileShareUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareUpdate model = BinaryData.fromString( + "{\"tags\":{\"zdatqxhocdg\":\"nhutjeltmrldhugj\"},\"properties\":{\"provisionedStorageGiB\":1293628182,\"provisionedIOPerSec\":950218840,\"provisionedThroughputMiBPerSec\":1780121294,\"nfsProtocolProperties\":{\"rootSquash\":\"NoRootSquash\",\"encryptionInTransitRequired\":\"Enabled\"},\"publicAccessProperties\":{\"allowedSubnets\":[\"ozwyiftyhxhuro\",\"ftyxolniw\",\"wcukjfkgiawxk\",\"ryplwckbasyypn\"]},\"publicNetworkAccess\":\"Disabled\"}}") + .toObject(FileShareUpdate.class); + Assertions.assertEquals("nhutjeltmrldhugj", model.tags().get("zdatqxhocdg")); + Assertions.assertEquals(1293628182, model.properties().provisionedStorageGiB()); + Assertions.assertEquals(950218840, model.properties().provisionedIOPerSec()); + Assertions.assertEquals(1780121294, model.properties().provisionedThroughputMiBPerSec()); + Assertions.assertEquals(ShareRootSquash.NO_ROOT_SQUASH, + model.properties().nfsProtocolProperties().rootSquash()); + Assertions.assertEquals(EncryptionInTransitRequired.ENABLED, + model.properties().nfsProtocolProperties().encryptionInTransitRequired()); + Assertions.assertEquals("ozwyiftyhxhuro", model.properties().publicAccessProperties().allowedSubnets().get(0)); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.properties().publicNetworkAccess()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FileShareUpdate model = new FileShareUpdate().withTags(mapOf("zdatqxhocdg", "nhutjeltmrldhugj")) + .withProperties(new FileShareUpdateProperties().withProvisionedStorageGiB(1293628182) + .withProvisionedIOPerSec(950218840) + .withProvisionedThroughputMiBPerSec(1780121294) + .withNfsProtocolProperties(new NfsProtocolProperties().withRootSquash(ShareRootSquash.NO_ROOT_SQUASH) + .withEncryptionInTransitRequired(EncryptionInTransitRequired.ENABLED)) + .withPublicAccessProperties(new PublicAccessProperties().withAllowedSubnets( + Arrays.asList("ozwyiftyhxhuro", "ftyxolniw", "wcukjfkgiawxk", "ryplwckbasyypn"))) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED)); + model = BinaryData.fromObject(model).toObject(FileShareUpdate.class); + Assertions.assertEquals("nhutjeltmrldhugj", model.tags().get("zdatqxhocdg")); + Assertions.assertEquals(1293628182, model.properties().provisionedStorageGiB()); + Assertions.assertEquals(950218840, model.properties().provisionedIOPerSec()); + Assertions.assertEquals(1780121294, model.properties().provisionedThroughputMiBPerSec()); + Assertions.assertEquals(ShareRootSquash.NO_ROOT_SQUASH, + model.properties().nfsProtocolProperties().rootSquash()); + Assertions.assertEquals(EncryptionInTransitRequired.ENABLED, + model.properties().nfsProtocolProperties().encryptionInTransitRequired()); + Assertions.assertEquals("ozwyiftyhxhuro", model.properties().publicAccessProperties().allowedSubnets().get(0)); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.properties().publicNetworkAccess()); + } + + // 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/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareUsageDataOutputTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareUsageDataOutputTests.java new file mode 100644 index 000000000000..95e9fcbde814 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareUsageDataOutputTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.FileShareUsageDataOutput; +import org.junit.jupiter.api.Assertions; + +public final class FileShareUsageDataOutputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareUsageDataOutput model = BinaryData.fromString("{\"liveShares\":{\"fileShareCount\":891101767}}") + .toObject(FileShareUsageDataOutput.class); + Assertions.assertEquals(891101767, model.liveShares().fileShareCount()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareUsageDataResponseInnerTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareUsageDataResponseInnerTests.java new file mode 100644 index 000000000000..9e53e9072f97 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileShareUsageDataResponseInnerTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.fluent.models.FileShareUsageDataResponseInner; +import org.junit.jupiter.api.Assertions; + +public final class FileShareUsageDataResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FileShareUsageDataResponseInner model + = BinaryData.fromString("{\"properties\":{\"liveShares\":{\"fileShareCount\":1948903121}}}") + .toObject(FileShareUsageDataResponseInner.class); + Assertions.assertEquals(1948903121, model.properties().liveShares().fileShareCount()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharesCheckNameAvailabilityWithResponseMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharesCheckNameAvailabilityWithResponseMockTests.java new file mode 100644 index 000000000000..b2de0efa312f --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharesCheckNameAvailabilityWithResponseMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.CheckNameAvailabilityReason; +import com.azure.resourcemanager.fileshares.models.CheckNameAvailabilityRequest; +import com.azure.resourcemanager.fileshares.models.CheckNameAvailabilityResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FileSharesCheckNameAvailabilityWithResponseMockTests { + @Test + public void testCheckNameAvailabilityWithResponse() throws Exception { + String responseStr = "{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"lhbnxkna\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + CheckNameAvailabilityResponse response = manager.fileShares() + .checkNameAvailabilityWithResponse("ixisxyawjoy", + new CheckNameAvailabilityRequest().withName("cslyjpk").withType("dzyexznelixh"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertTrue(response.nameAvailable()); + Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, response.reason()); + Assertions.assertEquals("lhbnxkna", response.message()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharesCreateOrUpdateMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharesCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..fdfacbc10af9 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharesCreateOrUpdateMockTests.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.EncryptionInTransitRequired; +import com.azure.resourcemanager.fileshares.models.FileShare; +import com.azure.resourcemanager.fileshares.models.FileShareProperties; +import com.azure.resourcemanager.fileshares.models.MediaTier; +import com.azure.resourcemanager.fileshares.models.NfsProtocolProperties; +import com.azure.resourcemanager.fileshares.models.Protocol; +import com.azure.resourcemanager.fileshares.models.PublicAccessProperties; +import com.azure.resourcemanager.fileshares.models.PublicNetworkAccess; +import com.azure.resourcemanager.fileshares.models.Redundancy; +import com.azure.resourcemanager.fileshares.models.ShareRootSquash; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FileSharesCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"mountName\":\"birx\",\"hostName\":\"ybsrfbjfdtwss\",\"mediaTier\":\"SSD\",\"redundancy\":\"Local\",\"protocol\":\"NFS\",\"provisionedStorageGiB\":1235013026,\"provisionedStorageNextAllowedDowngrade\":\"2021-06-16T07:23:52Z\",\"provisionedIOPerSec\":151747977,\"provisionedIOPerSecNextAllowedDowngrade\":\"2021-06-27T17:15:27Z\",\"provisionedThroughputMiBPerSec\":1551412306,\"provisionedThroughputNextAllowedDowngrade\":\"2021-04-20T20:21:02Z\",\"includedBurstIOPerSec\":956114198,\"maxBurstIOPerSecCredits\":7849718302372812487,\"nfsProtocolProperties\":{\"rootSquash\":\"NoRootSquash\",\"encryptionInTransitRequired\":\"Disabled\"},\"publicAccessProperties\":{\"allowedSubnets\":[\"mkcjhwqytjrybn\",\"jewgdrjerv\",\"aen\"]},\"provisioningState\":\"Succeeded\",\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"mifthnzdnd\",\"l\",\"nayqi\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"havhqlkthumaqolb\",\"name\":\"ycduier\",\"type\":\"gccymvaolpssl\"}]},\"location\":\"fmmdnbbg\",\"tags\":{\"sadbz\":\"swiydmcwyhzdx\",\"dvxzbncblylpst\":\"nvdfznuda\",\"rsc\":\"bhhxsrzdzuc\"},\"id\":\"ntnev\",\"name\":\"iwjmygtdssls\",\"type\":\"tmweriofzpyq\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + FileShare response = manager.fileShares() + .define("pnapnyiropuh") + .withRegion("qbhsfxobl") + .withExistingResourceGroup("aulppggd") + .withTags(mapOf("bkrvrnsvshqj", "blmpewww")) + .withProperties(new FileShareProperties().withMountName("vpgylgqgitxmed") + .withMediaTier(MediaTier.SSD) + .withRedundancy(Redundancy.LOCAL) + .withProtocol(Protocol.NFS) + .withProvisionedStorageGiB(282783230) + .withProvisionedIOPerSec(538641166) + .withProvisionedThroughputMiBPerSec(808952037) + .withNfsProtocolProperties(new NfsProtocolProperties().withRootSquash(ShareRootSquash.ALL_SQUASH) + .withEncryptionInTransitRequired(EncryptionInTransitRequired.ENABLED)) + .withPublicAccessProperties( + new PublicAccessProperties().withAllowedSubnets(Arrays.asList("wptfdy", "pfqbuaceopzf"))) + .withPublicNetworkAccess(PublicNetworkAccess.DISABLED)) + .create(); + + Assertions.assertEquals("fmmdnbbg", response.location()); + Assertions.assertEquals("swiydmcwyhzdx", response.tags().get("sadbz")); + Assertions.assertEquals("birx", response.properties().mountName()); + Assertions.assertEquals(MediaTier.SSD, response.properties().mediaTier()); + Assertions.assertEquals(Redundancy.LOCAL, response.properties().redundancy()); + Assertions.assertEquals(Protocol.NFS, response.properties().protocol()); + Assertions.assertEquals(1235013026, response.properties().provisionedStorageGiB()); + Assertions.assertEquals(151747977, response.properties().provisionedIOPerSec()); + Assertions.assertEquals(1551412306, response.properties().provisionedThroughputMiBPerSec()); + Assertions.assertEquals(ShareRootSquash.NO_ROOT_SQUASH, + response.properties().nfsProtocolProperties().rootSquash()); + Assertions.assertEquals(EncryptionInTransitRequired.DISABLED, + response.properties().nfsProtocolProperties().encryptionInTransitRequired()); + Assertions.assertEquals("mkcjhwqytjrybn", + response.properties().publicAccessProperties().allowedSubnets().get(0)); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, response.properties().publicNetworkAccess()); + } + + // 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/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharesGetByResourceGroupWithResponseMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharesGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..0ecc81cc65f8 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharesGetByResourceGroupWithResponseMockTests.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.EncryptionInTransitRequired; +import com.azure.resourcemanager.fileshares.models.FileShare; +import com.azure.resourcemanager.fileshares.models.MediaTier; +import com.azure.resourcemanager.fileshares.models.Protocol; +import com.azure.resourcemanager.fileshares.models.PublicNetworkAccess; +import com.azure.resourcemanager.fileshares.models.Redundancy; +import com.azure.resourcemanager.fileshares.models.ShareRootSquash; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FileSharesGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"mountName\":\"xdbabphlwr\",\"hostName\":\"fkts\",\"mediaTier\":\"SSD\",\"redundancy\":\"Zone\",\"protocol\":\"NFS\",\"provisionedStorageGiB\":2095135848,\"provisionedStorageNextAllowedDowngrade\":\"2021-06-06T00:56:44Z\",\"provisionedIOPerSec\":533461500,\"provisionedIOPerSecNextAllowedDowngrade\":\"2021-08-27T13:10:53Z\",\"provisionedThroughputMiBPerSec\":1372436938,\"provisionedThroughputNextAllowedDowngrade\":\"2021-08-28T10:19:16Z\",\"includedBurstIOPerSec\":1529613290,\"maxBurstIOPerSecCredits\":5267298804319679372,\"nfsProtocolProperties\":{\"rootSquash\":\"NoRootSquash\",\"encryptionInTransitRequired\":\"Disabled\"},\"publicAccessProperties\":{\"allowedSubnets\":[\"exzfeyue\",\"xibxujwbhqwalm\",\"zyoxaepdkzjan\"]},\"provisioningState\":\"TransientFailure\",\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"xbniwdjs\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Succeeded\"},\"id\":\"bpg\",\"name\":\"xytxhpzxbz\",\"type\":\"fzab\"},{\"properties\":{\"groupIds\":[\"hxw\",\"ctyqik\",\"bbovplwzbhvgyugu\",\"svmkfssxquk\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Succeeded\"},\"id\":\"mg\",\"name\":\"xnkjzkdesl\",\"type\":\"vlopwiyighx\"},{\"properties\":{\"groupIds\":[\"zb\",\"iuebbaumny\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"eojnabc\",\"name\":\"hsmtxpsiebtfhvp\",\"type\":\"sapskr\"}]},\"location\":\"mhjjdhtldwkyzx\",\"tags\":{\"ws\":\"kn\",\"vnm\":\"wsvlxotogtwrupqs\"},\"id\":\"cykvceo\",\"name\":\"eil\",\"type\":\"vnotyfjfcnj\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + FileShare response = manager.fileShares() + .getByResourceGroupWithResponse("qidybyx", "zfcl", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("mhjjdhtldwkyzx", response.location()); + Assertions.assertEquals("kn", response.tags().get("ws")); + Assertions.assertEquals("xdbabphlwr", response.properties().mountName()); + Assertions.assertEquals(MediaTier.SSD, response.properties().mediaTier()); + Assertions.assertEquals(Redundancy.ZONE, response.properties().redundancy()); + Assertions.assertEquals(Protocol.NFS, response.properties().protocol()); + Assertions.assertEquals(2095135848, response.properties().provisionedStorageGiB()); + Assertions.assertEquals(533461500, response.properties().provisionedIOPerSec()); + Assertions.assertEquals(1372436938, response.properties().provisionedThroughputMiBPerSec()); + Assertions.assertEquals(ShareRootSquash.NO_ROOT_SQUASH, + response.properties().nfsProtocolProperties().rootSquash()); + Assertions.assertEquals(EncryptionInTransitRequired.DISABLED, + response.properties().nfsProtocolProperties().encryptionInTransitRequired()); + Assertions.assertEquals("exzfeyue", response.properties().publicAccessProperties().allowedSubnets().get(0)); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, response.properties().publicNetworkAccess()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharesListByResourceGroupMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharesListByResourceGroupMockTests.java new file mode 100644 index 000000000000..bdd8e75dcd56 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharesListByResourceGroupMockTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.EncryptionInTransitRequired; +import com.azure.resourcemanager.fileshares.models.FileShare; +import com.azure.resourcemanager.fileshares.models.MediaTier; +import com.azure.resourcemanager.fileshares.models.Protocol; +import com.azure.resourcemanager.fileshares.models.PublicNetworkAccess; +import com.azure.resourcemanager.fileshares.models.Redundancy; +import com.azure.resourcemanager.fileshares.models.ShareRootSquash; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FileSharesListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"mountName\":\"wndnhj\",\"hostName\":\"uwhvylwzbtdhxujz\",\"mediaTier\":\"SSD\",\"redundancy\":\"Local\",\"protocol\":\"NFS\",\"provisionedStorageGiB\":2070148801,\"provisionedStorageNextAllowedDowngrade\":\"2021-06-11T09:32:45Z\",\"provisionedIOPerSec\":741975656,\"provisionedIOPerSecNextAllowedDowngrade\":\"2021-05-11T15:12:41Z\",\"provisionedThroughputMiBPerSec\":1484000584,\"provisionedThroughputNextAllowedDowngrade\":\"2021-02-19T06:27:55Z\",\"includedBurstIOPerSec\":194224762,\"maxBurstIOPerSecCredits\":4993789432354588709,\"nfsProtocolProperties\":{\"rootSquash\":\"RootSquash\",\"encryptionInTransitRequired\":\"Enabled\"},\"publicAccessProperties\":{\"allowedSubnets\":[\"s\",\"tjrip\",\"rbpbewtghfgblcg\",\"xzvlvqhjkbegib\"]},\"provisioningState\":\"Created\",\"publicNetworkAccess\":\"Disabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"loayqcgw\",\"tzjuzgwyzmhtxo\",\"gmtsavjcbpwxqpsr\",\"nftguvriuhpr\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Failed\"},\"id\":\"xqtayriwwro\",\"name\":\"qbex\",\"type\":\"mcqibycnojv\"},{\"properties\":{\"groupIds\":[\"fqsgzvahapjy\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"qzcjrvxdj\",\"name\":\"lmwlxkvugfhzo\",\"type\":\"awjvzunluthnnp\"}]},\"location\":\"xipeilpjzuaejx\",\"tags\":{\"pwo\":\"tskzbbtdzumveek\",\"fpbsjyofdxl\":\"uh\",\"ttouwaboekqvkel\":\"us\"},\"id\":\"smv\",\"name\":\"xwyjsflhhc\",\"type\":\"aln\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.fileShares().listByResourceGroup("hniskxfbkpyc", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("xipeilpjzuaejx", response.iterator().next().location()); + Assertions.assertEquals("tskzbbtdzumveek", response.iterator().next().tags().get("pwo")); + Assertions.assertEquals("wndnhj", response.iterator().next().properties().mountName()); + Assertions.assertEquals(MediaTier.SSD, response.iterator().next().properties().mediaTier()); + Assertions.assertEquals(Redundancy.LOCAL, response.iterator().next().properties().redundancy()); + Assertions.assertEquals(Protocol.NFS, response.iterator().next().properties().protocol()); + Assertions.assertEquals(2070148801, response.iterator().next().properties().provisionedStorageGiB()); + Assertions.assertEquals(741975656, response.iterator().next().properties().provisionedIOPerSec()); + Assertions.assertEquals(1484000584, response.iterator().next().properties().provisionedThroughputMiBPerSec()); + Assertions.assertEquals(ShareRootSquash.ROOT_SQUASH, + response.iterator().next().properties().nfsProtocolProperties().rootSquash()); + Assertions.assertEquals(EncryptionInTransitRequired.ENABLED, + response.iterator().next().properties().nfsProtocolProperties().encryptionInTransitRequired()); + Assertions.assertEquals("s", + response.iterator().next().properties().publicAccessProperties().allowedSubnets().get(0)); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, + response.iterator().next().properties().publicNetworkAccess()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharesListMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharesListMockTests.java new file mode 100644 index 000000000000..0587c131837f --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/FileSharesListMockTests.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.EncryptionInTransitRequired; +import com.azure.resourcemanager.fileshares.models.FileShare; +import com.azure.resourcemanager.fileshares.models.MediaTier; +import com.azure.resourcemanager.fileshares.models.Protocol; +import com.azure.resourcemanager.fileshares.models.PublicNetworkAccess; +import com.azure.resourcemanager.fileshares.models.Redundancy; +import com.azure.resourcemanager.fileshares.models.ShareRootSquash; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class FileSharesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"mountName\":\"nxdhbt\",\"hostName\":\"phywpnvj\",\"mediaTier\":\"SSD\",\"redundancy\":\"Zone\",\"protocol\":\"NFS\",\"provisionedStorageGiB\":1158367240,\"provisionedStorageNextAllowedDowngrade\":\"2021-08-01T15:40:57Z\",\"provisionedIOPerSec\":1456485650,\"provisionedIOPerSecNextAllowedDowngrade\":\"2021-09-07T09:24:33Z\",\"provisionedThroughputMiBPerSec\":1113646218,\"provisionedThroughputNextAllowedDowngrade\":\"2021-10-09T14:43:40Z\",\"includedBurstIOPerSec\":2041952882,\"maxBurstIOPerSecCredits\":8751195016646991326,\"nfsProtocolProperties\":{\"rootSquash\":\"NoRootSquash\",\"encryptionInTransitRequired\":\"Disabled\"},\"publicAccessProperties\":{\"allowedSubnets\":[\"zq\",\"gxywpmue\",\"fjz\",\"fqkquj\"]},\"provisioningState\":\"Provisioning\",\"publicNetworkAccess\":\"Enabled\",\"privateEndpointConnections\":[{\"properties\":{\"groupIds\":[\"laocqxtccmg\",\"udxytlmoyrx\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Succeeded\"},\"id\":\"wpzntxhdzh\",\"name\":\"rqjbhckfrl\",\"type\":\"rxsbkyvp\"},{\"properties\":{\"groupIds\":[\"uzbpzkafku\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Succeeded\"},\"id\":\"wbme\",\"name\":\"hseyvju\",\"type\":\"rts\"},{\"properties\":{\"groupIds\":[\"kdeemaofmxagkvtm\",\"lmqkrhahvlj\",\"ahaquh\",\"dhmdua\"],\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"pvfadmwsrcr\",\"name\":\"vxpvgomz\",\"type\":\"fmisg\"}]},\"location\":\"nbbelda\",\"tags\":{\"hsfwxosowzxcug\":\"baliourqhakauha\",\"ovbvmeueciv\":\"cjooxdjebwpucwwf\",\"otwmcdyt\":\"hzceuojgjrwjue\"},\"id\":\"x\",\"name\":\"it\",\"type\":\"nrjawgqwg\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.fileShares().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("nbbelda", response.iterator().next().location()); + Assertions.assertEquals("baliourqhakauha", response.iterator().next().tags().get("hsfwxosowzxcug")); + Assertions.assertEquals("nxdhbt", response.iterator().next().properties().mountName()); + Assertions.assertEquals(MediaTier.SSD, response.iterator().next().properties().mediaTier()); + Assertions.assertEquals(Redundancy.ZONE, response.iterator().next().properties().redundancy()); + Assertions.assertEquals(Protocol.NFS, response.iterator().next().properties().protocol()); + Assertions.assertEquals(1158367240, response.iterator().next().properties().provisionedStorageGiB()); + Assertions.assertEquals(1456485650, response.iterator().next().properties().provisionedIOPerSec()); + Assertions.assertEquals(1113646218, response.iterator().next().properties().provisionedThroughputMiBPerSec()); + Assertions.assertEquals(ShareRootSquash.NO_ROOT_SQUASH, + response.iterator().next().properties().nfsProtocolProperties().rootSquash()); + Assertions.assertEquals(EncryptionInTransitRequired.DISABLED, + response.iterator().next().properties().nfsProtocolProperties().encryptionInTransitRequired()); + Assertions.assertEquals("zq", + response.iterator().next().properties().publicAccessProperties().allowedSubnets().get(0)); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, + response.iterator().next().properties().publicNetworkAccess()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetLimitsWithResponseMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetLimitsWithResponseMockTests.java new file mode 100644 index 000000000000..8b1f9aad46dc --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetLimitsWithResponseMockTests.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.FileShareLimitsResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class InformationalOperationsGetLimitsWithResponseMockTests { + @Test + public void testGetLimitsWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"limits\":{\"maxFileShares\":1701061135,\"maxFileShareSnapshots\":1258366887,\"maxFileShareSubnets\":393734239,\"maxFileSharePrivateEndpointConnections\":649477703,\"minProvisionedStorageGiB\":943919605,\"maxProvisionedStorageGiB\":60814629,\"minProvisionedIOPerSec\":1383619855,\"maxProvisionedIOPerSec\":800082776,\"minProvisionedThroughputMiBPerSec\":1193557953,\"maxProvisionedThroughputMiBPerSec\":1475281926},\"provisioningConstants\":{\"baseIOPerSec\":1582782062,\"scalarIOPerSec\":43.367403188188604,\"baseThroughputMiBPerSec\":138973043,\"scalarThroughputMiBPerSec\":51.562118966524096,\"guardrailIOPerSecScalar\":26.700803678719577,\"guardrailThroughputScalar\":62.63083190962946}}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + FileShareLimitsResponse response = manager.informationalOperations() + .getLimitsWithResponse("cvqvpkeqdcv", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(1701061135, response.properties().limits().maxFileShares()); + Assertions.assertEquals(1258366887, response.properties().limits().maxFileShareSnapshots()); + Assertions.assertEquals(393734239, response.properties().limits().maxFileShareSubnets()); + Assertions.assertEquals(649477703, response.properties().limits().maxFileSharePrivateEndpointConnections()); + Assertions.assertEquals(943919605, response.properties().limits().minProvisionedStorageGiB()); + Assertions.assertEquals(60814629, response.properties().limits().maxProvisionedStorageGiB()); + Assertions.assertEquals(1383619855, response.properties().limits().minProvisionedIOPerSec()); + Assertions.assertEquals(800082776, response.properties().limits().maxProvisionedIOPerSec()); + Assertions.assertEquals(1193557953, response.properties().limits().minProvisionedThroughputMiBPerSec()); + Assertions.assertEquals(1475281926, response.properties().limits().maxProvisionedThroughputMiBPerSec()); + Assertions.assertEquals(1582782062, response.properties().provisioningConstants().baseIOPerSec()); + Assertions.assertEquals(43.367403188188604, response.properties().provisioningConstants().scalarIOPerSec()); + Assertions.assertEquals(138973043, response.properties().provisioningConstants().baseThroughputMiBPerSec()); + Assertions.assertEquals(51.562118966524096, + response.properties().provisioningConstants().scalarThroughputMiBPerSec()); + Assertions.assertEquals(26.700803678719577, + response.properties().provisioningConstants().guardrailIOPerSecScalar()); + Assertions.assertEquals(62.63083190962946, + response.properties().provisioningConstants().guardrailThroughputScalar()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetProvisioningRecommendationWithResponseMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetProvisioningRecommendationWithResponseMockTests.java new file mode 100644 index 000000000000..b4d69ced8672 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetProvisioningRecommendationWithResponseMockTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationInput; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationRequest; +import com.azure.resourcemanager.fileshares.models.FileShareProvisioningRecommendationResponse; +import com.azure.resourcemanager.fileshares.models.Redundancy; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class InformationalOperationsGetProvisioningRecommendationWithResponseMockTests { + @Test + public void testGetProvisioningRecommendationWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisionedIOPerSec\":1819120953,\"provisionedThroughputMiBPerSec\":1757688267,\"availableRedundancyOptions\":[\"Local\",\"Zone\"]}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + FileShareProvisioningRecommendationResponse response = manager.informationalOperations() + .getProvisioningRecommendationWithResponse("nhdldwmgxcx", + new FileShareProvisioningRecommendationRequest().withProperties( + new FileShareProvisioningRecommendationInput().withProvisionedStorageGiB(121454695)), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(1819120953, response.properties().provisionedIOPerSec()); + Assertions.assertEquals(1757688267, response.properties().provisionedThroughputMiBPerSec()); + Assertions.assertEquals(Redundancy.LOCAL, response.properties().availableRedundancyOptions().get(0)); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetUsageDataWithResponseMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetUsageDataWithResponseMockTests.java new file mode 100644 index 000000000000..0a0e5d155521 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/InformationalOperationsGetUsageDataWithResponseMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.FileShareUsageDataResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class InformationalOperationsGetUsageDataWithResponseMockTests { + @Test + public void testGetUsageDataWithResponse() throws Exception { + String responseStr = "{\"properties\":{\"liveShares\":{\"fileShareCount\":2005026599}}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + FileShareUsageDataResponse response = manager.informationalOperations() + .getUsageDataWithResponse("nedgfbc", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(2005026599, response.properties().liveShares().fileShareCount()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/LiveSharesUsageDataTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/LiveSharesUsageDataTests.java new file mode 100644 index 000000000000..8c8d051395c4 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/LiveSharesUsageDataTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.LiveSharesUsageData; +import org.junit.jupiter.api.Assertions; + +public final class LiveSharesUsageDataTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LiveSharesUsageData model + = BinaryData.fromString("{\"fileShareCount\":825397815}").toObject(LiveSharesUsageData.class); + Assertions.assertEquals(825397815, model.fileShareCount()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/NfsProtocolPropertiesTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/NfsProtocolPropertiesTests.java new file mode 100644 index 000000000000..b8253b2b3122 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/NfsProtocolPropertiesTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.EncryptionInTransitRequired; +import com.azure.resourcemanager.fileshares.models.NfsProtocolProperties; +import com.azure.resourcemanager.fileshares.models.ShareRootSquash; +import org.junit.jupiter.api.Assertions; + +public final class NfsProtocolPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NfsProtocolProperties model + = BinaryData.fromString("{\"rootSquash\":\"NoRootSquash\",\"encryptionInTransitRequired\":\"Enabled\"}") + .toObject(NfsProtocolProperties.class); + Assertions.assertEquals(ShareRootSquash.NO_ROOT_SQUASH, model.rootSquash()); + Assertions.assertEquals(EncryptionInTransitRequired.ENABLED, model.encryptionInTransitRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NfsProtocolProperties model = new NfsProtocolProperties().withRootSquash(ShareRootSquash.NO_ROOT_SQUASH) + .withEncryptionInTransitRequired(EncryptionInTransitRequired.ENABLED); + model = BinaryData.fromObject(model).toObject(NfsProtocolProperties.class); + Assertions.assertEquals(ShareRootSquash.NO_ROOT_SQUASH, model.rootSquash()); + Assertions.assertEquals(EncryptionInTransitRequired.ENABLED, model.encryptionInTransitRequired()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/OperationDisplayTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/OperationDisplayTests.java new file mode 100644 index 000000000000..abe242e8a07e --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/OperationDisplayTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"b\",\"resource\":\"czvyifq\",\"operation\":\"kdvjsll\",\"description\":\"vvdfwatkpnpul\"}") + .toObject(OperationDisplay.class); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/OperationInnerTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/OperationInnerTests.java new file mode 100644 index 000000000000..8a487e135c8a --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/OperationInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.fluent.models.OperationInner; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = BinaryData.fromString( + "{\"name\":\"xbezyiuokktwh\",\"isDataAction\":false,\"display\":{\"provider\":\"ywqsmbsurexim\",\"resource\":\"yocf\",\"operation\":\"ksymd\",\"description\":\"stkiiuxhqyud\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + .toObject(OperationInner.class); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/OperationListResultTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/OperationListResultTests.java new file mode 100644 index 000000000000..6ec25c7009b2 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/OperationListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"usue\",\"isDataAction\":true,\"display\":{\"provider\":\"ej\",\"resource\":\"vorxzdmohct\",\"operation\":\"vudwx\",\"description\":\"dnvowg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"dkcglhsl\",\"isDataAction\":true,\"display\":{\"provider\":\"ggd\",\"resource\":\"ixhbkuofqweykhm\",\"operation\":\"evfyexfwhybcib\",\"description\":\"vdcsitynn\"},\"origin\":\"user\",\"actionType\":\"Internal\"},{\"name\":\"tehfiqscjeypvh\",\"isDataAction\":true,\"display\":{\"provider\":\"q\",\"resource\":\"jrefovgmkqsle\",\"operation\":\"vxyqjpkcattpngjc\",\"description\":\"czsqpjhvm\"},\"origin\":\"user\",\"actionType\":\"Internal\"},{\"name\":\"sounqecanoaeu\",\"isDataAction\":false,\"display\":{\"provider\":\"ltrpmopj\",\"resource\":\"matuok\",\"operation\":\"fu\",\"description\":\"aodsfcpkv\"},\"origin\":\"user\",\"actionType\":\"Internal\"}],\"nextLink\":\"zmyzydagf\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("zmyzydagf", model.nextLink()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/OperationsListMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/OperationsListMockTests.java new file mode 100644 index 000000000000..edb46e512d2b --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/OperationsListMockTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.Operation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"name\":\"iswac\",\"isDataAction\":false,\"display\":{\"provider\":\"zzewkfvhqcrai\",\"resource\":\"pnppfuf\",\"operation\":\"wdmhdlxyjrxs\",\"description\":\"afcnih\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionInnerTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionInnerTests.java new file mode 100644 index 000000000000..4c1a3350b983 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionInnerTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.fileshares.models.PrivateEndpoint; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.fileshares.models.PrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionInner model = BinaryData.fromString( + "{\"properties\":{\"groupIds\":[\"ginuvamih\",\"ognarxzxtheotus\",\"vyevcciqi\",\"nhungbw\"],\"privateEndpoint\":{\"id\":\"nfygxgispemvtz\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ubljofxqe\",\"actionsRequired\":\"jaeq\"},\"provisioningState\":\"Creating\"},\"id\":\"b\",\"name\":\"s\",\"type\":\"msmjqulngsntn\"}") + .toObject(PrivateEndpointConnectionInner.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + model.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("ubljofxqe", model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("jaeq", model.properties().privateLinkServiceConnectionState().actionsRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionInner model + = new PrivateEndpointConnectionInner() + .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("ubljofxqe") + .withActionsRequired("jaeq"))); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + model.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("ubljofxqe", model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("jaeq", model.properties().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionListResultTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionListResultTests.java new file mode 100644 index 000000000000..a637ee27ed5f --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionListResultTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.implementation.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointServiceConnectionStatus; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"groupIds\":[\"auu\",\"mjmvxieduugidyjr\"],\"privateEndpoint\":{\"id\":\"y\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"e\",\"actionsRequired\":\"sonpclhocohs\"},\"provisioningState\":\"Succeeded\"},\"id\":\"leggzfbu\",\"name\":\"fmvfaxkffeiit\",\"type\":\"lvmezyvshxmzsbbz\"}],\"nextLink\":\"gigr\"}") + .toObject(PrivateEndpointConnectionListResult.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + model.value().get(0).properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("e", + model.value().get(0).properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("sonpclhocohs", + model.value().get(0).properties().privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("gigr", model.nextLink()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionPropertiesTests.java new file mode 100644 index 000000000000..8b262ce3092f --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionPropertiesTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.PrivateEndpoint; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.fileshares.models.PrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionProperties model = BinaryData.fromString( + "{\"groupIds\":[\"kzgcwrwcl\",\"xwrljdouskcqvkoc\",\"cjdkwtnhxbnjbi\"],\"privateEndpoint\":{\"id\":\"rglssainqpj\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ljfmppee\",\"actionsRequired\":\"mgxsab\"},\"provisioningState\":\"Failed\"}") + .toObject(PrivateEndpointConnectionProperties.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("ljfmppee", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("mgxsab", model.privateLinkServiceConnectionState().actionsRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionProperties model + = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("ljfmppee") + .withActionsRequired("mgxsab")); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("ljfmppee", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("mgxsab", model.privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsCreateMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsCreateMockTests.java new file mode 100644 index 000000000000..cb983f80f284 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsCreateMockTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.PrivateEndpoint; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointConnection; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.fileshares.models.PrivateLinkServiceConnectionState; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsCreateMockTests { + @Test + public void testCreate() throws Exception { + String responseStr + = "{\"properties\":{\"groupIds\":[\"novvqfovljxy\"],\"privateEndpoint\":{\"id\":\"w\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ndsytgadg\",\"actionsRequired\":\"aeaeneqnzarrw\"},\"provisioningState\":\"Succeeded\"},\"id\":\"ijfqkacewiipfp\",\"name\":\"bjibwwiftohq\",\"type\":\"vpuvks\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnection response + = manager.privateEndpointConnections() + .define("kcnqxwbpo") + .withExistingFileShare("wo", "nwashrtd") + .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("pqwcciuqgbdbutau") + .withActionsRequired("btkuwhh"))) + .create(); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + response.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("ndsytgadg", response.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("aeaeneqnzarrw", + response.properties().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsDeleteMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsDeleteMockTests.java new file mode 100644 index 000000000000..2bfd980de473 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsDeleteMockTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsDeleteMockTests { + @Test + public void testDelete() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.privateEndpointConnections().delete("v", "ajqgxy", "mocmbqfqvmk", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java new file mode 100644 index 000000000000..2789cb903e71 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointConnection; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointServiceConnectionStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"groupIds\":[\"cpdggkzzlvmbmp\"],\"privateEndpoint\":{\"id\":\"odfvuefywsbp\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"yhrfouyftaakcpw\",\"actionsRequired\":\"zvqtmnubexkp\"},\"provisioningState\":\"Creating\"},\"id\":\"ondjmq\",\"name\":\"xvy\",\"type\":\"omgkopkwho\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnection response = manager.privateEndpointConnections() + .getWithResponse("wuoegrpk", "jw", "iyq", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + response.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("yhrfouyftaakcpw", + response.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("zvqtmnubexkp", + response.properties().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsListByFileShareMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsListByFileShareMockTests.java new file mode 100644 index 000000000000..6e9db7421889 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointConnectionsListByFileShareMockTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointConnection; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointServiceConnectionStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsListByFileShareMockTests { + @Test + public void testListByFileShare() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"groupIds\":[\"kcbcue\"],\"privateEndpoint\":{\"id\":\"xgc\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"rhos\",\"actionsRequired\":\"dqrhzoymib\"},\"provisioningState\":\"Succeeded\"},\"id\":\"ibahwflus\",\"name\":\"dtmhrkwofyyvoqa\",\"type\":\"piexpbtgiw\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.privateEndpointConnections() + .listByFileShare("xozap", "helxprglya", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, + response.iterator().next().properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("rhos", + response.iterator().next().properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("dqrhzoymib", + response.iterator().next().properties().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointTests.java new file mode 100644 index 000000000000..d2b8ca6a3b09 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateEndpointTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.PrivateEndpoint; + +public final class PrivateEndpointTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpoint model = BinaryData.fromString("{\"id\":\"uujitcjc\"}").toObject(PrivateEndpoint.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpoint model = new PrivateEndpoint(); + model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourceInnerTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourceInnerTests.java new file mode 100644 index 000000000000..a8be5430cf39 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourceInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.fluent.models.PrivateLinkResourceInner; + +public final class PrivateLinkResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceInner model = BinaryData.fromString( + "{\"properties\":{\"groupId\":\"ur\",\"requiredMembers\":[\"xjnspy\",\"ptkoenkoukn\",\"udwtiukbl\"],\"requiredZoneNames\":[\"kpoc\",\"pazyxoegukg\",\"npiucgygevqznty\",\"mrbpizcdrqj\"]},\"id\":\"pyd\",\"name\":\"fyhxde\",\"type\":\"ejzicwifsjtt\"}") + .toObject(PrivateLinkResourceInner.class); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourceListResultTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourceListResultTests.java new file mode 100644 index 000000000000..2e0f47b3017f --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourceListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.implementation.models.PrivateLinkResourceListResult; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkResourceListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"groupId\":\"rnkcqvyxlw\",\"requiredMembers\":[\"sicohoqqnwvlry\",\"vwhheunmmqhgyx\",\"konocu\"],\"requiredZoneNames\":[\"lyaxuc\",\"nuqszfkbey\",\"ewrmjmwvvjektc\"]},\"id\":\"enhwlrs\",\"name\":\"frzpwvlqdqgb\",\"type\":\"qylihkaetckt\"},{\"properties\":{\"groupId\":\"ivfsnk\",\"requiredMembers\":[\"ctq\",\"jf\",\"ebrjcxe\"],\"requiredZoneNames\":[\"wutttxfvjrbi\",\"phxepcyvahf\",\"ljkyqxjvuuj\",\"gidokgjljyoxgvcl\"]},\"id\":\"gsncghkjeszz\",\"name\":\"bijhtxfvgxbf\",\"type\":\"mxnehmp\"},{\"properties\":{\"groupId\":\"xgodebfqkkrbmp\",\"requiredMembers\":[\"riwflzlfb\"],\"requiredZoneNames\":[\"uzycispnqza\"]},\"id\":\"gkbrpyyd\",\"name\":\"ibnuqqkpik\",\"type\":\"drgvtqagn\"},{\"properties\":{\"groupId\":\"nhijggmebfsi\",\"requiredMembers\":[\"utrc\"],\"requiredZoneNames\":[\"azzmhjrunmpxt\"]},\"id\":\"bh\",\"name\":\"bnlankxmyskpb\",\"type\":\"enbtkcxywny\"}],\"nextLink\":\"rsyn\"}") + .toObject(PrivateLinkResourceListResult.class); + Assertions.assertEquals("rsyn", model.nextLink()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourcePropertiesTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourcePropertiesTests.java new file mode 100644 index 000000000000..5251b36169d1 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourcePropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.PrivateLinkResourceProperties; + +public final class PrivateLinkResourcePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceProperties model = BinaryData.fromString( + "{\"groupId\":\"fbishcbkha\",\"requiredMembers\":[\"yeamdphagalpb\",\"xw\"],\"requiredZoneNames\":[\"whonowk\",\"shwankixzbinje\",\"uttmrywnuzoqft\"]}") + .toObject(PrivateLinkResourceProperties.class); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourcesGetWithResponseMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourcesGetWithResponseMockTests.java new file mode 100644 index 000000000000..a9a81a458051 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourcesGetWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.PrivateLinkResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateLinkResourcesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"groupId\":\"leosjswsrms\",\"requiredMembers\":[\"rpzbchckqqzqi\",\"xiy\"],\"requiredZoneNames\":[\"i\",\"ynkedyatrwyhqmib\",\"yhwitsmypyynpcdp\",\"mnzgmwznmabi\"]},\"id\":\"sorgj\",\"name\":\"xbldtlwwrlkdmtn\",\"type\":\"vokotllxdyh\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateLinkResource response = manager.privateLinkResources() + .getWithResponse("plsaknynfsynljph", "op", "odlqiyntor", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourcesListMockTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourcesListMockTests.java new file mode 100644 index 000000000000..a41063bcf1fd --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkResourcesListMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.fileshares.FilesharesManager; +import com.azure.resourcemanager.fileshares.models.PrivateLinkResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateLinkResourcesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"groupId\":\"qgxqquezikyw\",\"requiredMembers\":[\"kallatmel\",\"uipiccjzk\"],\"requiredZoneNames\":[\"gvvcnayrhyr\"]},\"id\":\"xmueed\",\"name\":\"drd\",\"type\":\"stkwqqtch\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + FilesharesManager manager = FilesharesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.privateLinkResources().list("syocogjltdtbnnha", "oocrkvcikhnv", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkServiceConnectionStateTests.java new file mode 100644 index 000000000000..1bad2dc14898 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PrivateLinkServiceConnectionStateTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.fileshares.models.PrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkServiceConnectionStateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkServiceConnectionState model = BinaryData + .fromString("{\"status\":\"Pending\",\"description\":\"vndhkrwpdapp\",\"actionsRequired\":\"bdkvwrwjf\"}") + .toObject(PrivateLinkServiceConnectionState.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); + Assertions.assertEquals("vndhkrwpdapp", model.description()); + Assertions.assertEquals("bdkvwrwjf", model.actionsRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateLinkServiceConnectionState model + = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("vndhkrwpdapp") + .withActionsRequired("bdkvwrwjf"); + model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.status()); + Assertions.assertEquals("vndhkrwpdapp", model.description()); + Assertions.assertEquals("bdkvwrwjf", model.actionsRequired()); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PublicAccessPropertiesTests.java b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PublicAccessPropertiesTests.java new file mode 100644 index 000000000000..a3a01a7b5464 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/src/test/java/com/azure/resourcemanager/fileshares/generated/PublicAccessPropertiesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.fileshares.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.fileshares.models.PublicAccessProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class PublicAccessPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PublicAccessProperties model + = BinaryData.fromString("{\"allowedSubnets\":[\"jkjlxofpdvhpfx\",\"ypininm\",\"yhuybbkpod\"]}") + .toObject(PublicAccessProperties.class); + Assertions.assertEquals("jkjlxofpdvhpfx", model.allowedSubnets().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PublicAccessProperties model + = new PublicAccessProperties().withAllowedSubnets(Arrays.asList("jkjlxofpdvhpfx", "ypininm", "yhuybbkpod")); + model = BinaryData.fromObject(model).toObject(PublicAccessProperties.class); + Assertions.assertEquals("jkjlxofpdvhpfx", model.allowedSubnets().get(0)); + } +} diff --git a/sdk/fileshares/azure-resourcemanager-fileshares/tsp-location.yaml b/sdk/fileshares/azure-resourcemanager-fileshares/tsp-location.yaml new file mode 100644 index 000000000000..f25d8d252f87 --- /dev/null +++ b/sdk/fileshares/azure-resourcemanager-fileshares/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/fileshares/resource-manager/Microsoft.FileShares/FileShares +commit: 10936f3580808a031acfadffe8eae35aa29a9b5d +repo: ankushbindlish2/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/fileshares/ci.yml b/sdk/fileshares/ci.yml new file mode 100644 index 000000000000..780c2f7b65e5 --- /dev/null +++ b/sdk/fileshares/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/fileshares/ci.yml + - sdk/fileshares/azure-resourcemanager-fileshares/ + exclude: + - sdk/fileshares/pom.xml + - sdk/fileshares/azure-resourcemanager-fileshares/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fileshares/ci.yml + - sdk/fileshares/azure-resourcemanager-fileshares/ + exclude: + - sdk/fileshares/pom.xml + - sdk/fileshares/azure-resourcemanager-fileshares/pom.xml + +parameters: + - name: release_azureresourcemanagerfileshares + displayName: azure-resourcemanager-fileshares + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: fileshares + Artifacts: + - name: azure-resourcemanager-fileshares + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerfileshares + releaseInBatch: ${{ parameters.release_azureresourcemanagerfileshares }} diff --git a/sdk/fileshares/pom.xml b/sdk/fileshares/pom.xml new file mode 100644 index 000000000000..9b96c6a007d6 --- /dev/null +++ b/sdk/fileshares/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-fileshares-service + pom + 1.0.0 + + + azure-resourcemanager-fileshares + +