From 641c43b56fa8d8e96471775a652d1840992122d0 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 10 Jun 2021 04:23:11 +0000 Subject: [PATCH] CodeGen from PR 14407 in Azure/azure-rest-api-specs [StorageSync] Publish 2020-09-01 as stable API version (#14407) * DONOT COMMIT: Microsoft.StorageSync : Update Api Version 2020-09-01 (preview) for InitialUploadPolicy feature. (#11392) * update initialuploadpolicy * Update test for InitialUploadPolicy setting Co-authored-by: Manish Duggal * [Microsoft.StorageSync] change enumeration protocol changes for 2020-09-01 (#12793) * change eumeration protocol changes * fix unexpected changes * StorageSync new api version 2020-09-01 (#14005) * change * del * revert * Remove systemData changes (postponed to future API version) * run prettier * Address breaking changes and S360 item for default values * run prettier Co-authored-by: Andre Pinto Co-authored-by: Manishd79 Co-authored-by: Manish Duggal Co-authored-by: ankushbindlish2 <34896519+ankushbindlish2@users.noreply.github.com> --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 101 + .../azure-resourcemanager-storagesync/pom.xml | 86 + .../storagesync/StoragesyncManager.java | 325 ++ .../fluent/CloudEndpointsClient.java | 758 ++++ .../fluent/MicrosoftStorageSync.java | 116 + .../OperationStatusOperationsClient.java | 48 + .../storagesync/fluent/OperationsClient.java | 38 + .../PrivateEndpointConnectionsClient.java | 238 ++ .../fluent/PrivateLinkResourcesClient.java | 43 + .../fluent/RegisteredServersClient.java | 304 ++ .../fluent/ServerEndpointsClient.java | 459 +++ .../fluent/StorageSyncServicesClient.java | 347 ++ .../storagesync/fluent/SyncGroupsClient.java | 153 + .../storagesync/fluent/WorkflowsClient.java | 109 + .../CheckNameAvailabilityResultInner.java | 75 + .../fluent/models/CloudEndpointInner.java | 269 ++ .../fluent/models/OperationEntityInner.java | 136 + .../fluent/models/OperationStatusInner.java | 104 + .../models/PostBackupResponseInner.java | 41 + .../PrivateEndpointConnectionInner.java | 107 + .../PrivateLinkResourceListResultInner.java | 55 + .../fluent/models/RegisteredServerInner.java | 594 +++ .../fluent/models/ServerEndpointInner.java | 471 +++ .../models/StorageSyncServiceInner.java | 165 + .../fluent/models/SyncGroupInner.java | 57 + .../fluent/models/WorkflowInner.java | 205 + .../fluent/models/package-info.java | 6 + .../storagesync/fluent/package-info.java | 6 + .../CheckNameAvailabilityResultImpl.java | 42 + .../implementation/CloudEndpointImpl.java | 264 ++ .../CloudEndpointsClientImpl.java | 3308 +++++++++++++++++ .../implementation/CloudEndpointsImpl.java | 411 ++ .../MicrosoftStorageSyncBuilder.java | 146 + .../MicrosoftStorageSyncImpl.java | 419 +++ .../implementation/OperationEntityImpl.java | 46 + .../implementation/OperationStatusImpl.java | 50 + .../OperationStatusOperationsClientImpl.java | 253 ++ .../OperationStatusOperationsImpl.java | 63 + .../implementation/OperationsClientImpl.java | 269 ++ .../implementation/OperationsImpl.java | 46 + .../PostBackupResponseImpl.java | 32 + .../PrivateEndpointConnectionImpl.java | 137 + .../PrivateEndpointConnectionsClientImpl.java | 1153 ++++++ .../PrivateEndpointConnectionsImpl.java | 226 ++ .../PrivateLinkResourceListResultImpl.java | 41 + .../PrivateLinkResourcesClientImpl.java | 228 ++ .../PrivateLinkResourcesImpl.java | 66 + .../implementation/RegisteredServerImpl.java | 254 ++ .../RegisteredServersClientImpl.java | 1390 +++++++ .../implementation/RegisteredServersImpl.java | 224 ++ .../implementation/ServerEndpointImpl.java | 350 ++ .../ServerEndpointsClientImpl.java | 2004 ++++++++++ .../implementation/ServerEndpointsImpl.java | 277 ++ .../StorageSyncServiceImpl.java | 228 ++ .../StorageSyncServicesClientImpl.java | 1631 ++++++++ .../StorageSyncServicesImpl.java | 210 ++ .../implementation/SyncGroupImpl.java | 116 + .../implementation/SyncGroupsClientImpl.java | 844 +++++ .../implementation/SyncGroupsImpl.java | 204 + .../storagesync/implementation/Utils.java | 204 + .../implementation/WorkflowImpl.java | 74 + .../implementation/WorkflowsClientImpl.java | 619 +++ .../implementation/WorkflowsImpl.java | 86 + .../implementation/package-info.java | 6 + .../storagesync/models/BackupRequest.java | 50 + .../models/ChangeDetectionMode.java | 34 + .../CheckNameAvailabilityParameters.java | 88 + .../models/CheckNameAvailabilityResult.java | 40 + .../storagesync/models/CloudEndpoint.java | 351 ++ .../models/CloudEndpointArray.java | 55 + ...loudEndpointChangeEnumerationActivity.java | 224 ++ ...ndpointChangeEnumerationActivityState.java | 37 + .../CloudEndpointChangeEnumerationStatus.java | 76 + ...ointChangeEnumerationTotalCountsState.java | 35 + .../models/CloudEndpointCreateParameters.java | 131 + ...udEndpointLastChangeEnumerationStatus.java | 115 + .../storagesync/models/CloudEndpoints.java | 421 +++ .../models/CloudEndpointsCreateHeaders.java | 154 + .../models/CloudEndpointsCreateResponse.java | 37 + .../models/CloudEndpointsDeleteHeaders.java | 154 + .../models/CloudEndpointsDeleteResponse.java | 26 + .../models/CloudEndpointsGetHeaders.java | 76 + .../models/CloudEndpointsGetResponse.java | 37 + .../CloudEndpointsListBySyncGroupHeaders.java | 76 + ...CloudEndpointsListBySyncGroupResponse.java | 37 + .../CloudEndpointsPostBackupHeaders.java | 102 + .../CloudEndpointsPostBackupResponse.java | 38 + .../CloudEndpointsPostRestoreHeaders.java | 102 + .../CloudEndpointsPostRestoreResponse.java | 30 + .../CloudEndpointsPreBackupHeaders.java | 102 + .../CloudEndpointsPreBackupResponse.java | 30 + .../CloudEndpointsPreRestoreHeaders.java | 102 + .../CloudEndpointsPreRestoreResponse.java | 30 + ...CloudEndpointsRestoreheartbeatHeaders.java | 76 + ...loudEndpointsRestoreheartbeatResponse.java | 31 + ...ndpointsTriggerChangeDetectionHeaders.java | 102 + ...dpointsTriggerChangeDetectionResponse.java | 31 + .../models/CloudTieringCachePerformance.java | 87 + .../models/CloudTieringDatePolicyStatus.java | 55 + .../models/CloudTieringFilesNotTiering.java | 74 + .../models/CloudTieringSpaceSavings.java | 115 + ...oudTieringVolumeFreeSpacePolicyStatus.java | 72 + .../storagesync/models/FeatureStatus.java | 34 + .../models/FilesNotTieringError.java | 54 + .../models/IncomingTrafficPolicy.java | 34 + .../models/InitialDownloadPolicy.java | 37 + .../models/InitialUploadPolicy.java | 34 + .../storagesync/models/LocalCacheMode.java | 34 + .../models/NameAvailabilityReason.java | 47 + .../models/OperationDirection.java | 37 + .../models/OperationDisplayInfo.java | 128 + .../storagesync/models/OperationEntity.java | 45 + .../models/OperationEntityListResult.java | 81 + .../models/OperationProperties.java | 53 + .../OperationResourceMetricSpecification.java | 211 ++ ...nResourceMetricSpecificationDimension.java | 103 + ...OperationResourceServiceSpecification.java | 55 + .../storagesync/models/OperationStatus.java | 53 + .../models/OperationStatusOperations.java | 43 + .../OperationStatusOperationsGetHeaders.java | 76 + .../OperationStatusOperationsGetResponse.java | 38 + .../storagesync/models/Operations.java | 33 + .../models/OperationsListHeaders.java | 76 + .../models/OperationsListNextHeaders.java | 76 + .../models/OperationsListNextResponse.java | 37 + .../models/OperationsListResponse.java | 36 + .../models/PostBackupResponse.java | 24 + .../models/PostRestoreRequest.java | 236 ++ .../storagesync/models/PreRestoreRequest.java | 265 ++ .../storagesync/models/PrivateEndpoint.java | 39 + .../models/PrivateEndpointConnection.java | 144 + .../PrivateEndpointConnectionListResult.java | 55 + ...teEndpointConnectionProvisioningState.java | 41 + .../models/PrivateEndpointConnections.java | 160 + ...ivateEndpointConnectionsCreateHeaders.java | 154 + ...vateEndpointConnectionsCreateResponse.java | 38 + ...ivateEndpointConnectionsDeleteHeaders.java | 154 + ...vateEndpointConnectionsDeleteResponse.java | 31 + ...ctionsListByStorageSyncServiceHeaders.java | 79 + ...tionsListByStorageSyncServiceResponse.java | 38 + ...rivateEndpointServiceConnectionStatus.java | 38 + .../models/PrivateLinkResource.java | 84 + .../models/PrivateLinkResourceListResult.java | 25 + .../models/PrivateLinkResources.java | 37 + .../PrivateLinkServiceConnectionState.java | 108 + .../storagesync/models/Reason.java | 43 + .../models/RecallActionParameters.java | 76 + .../storagesync/models/RegisteredServer.java | 379 ++ .../RegisteredServerAgentVersionStatus.java | 40 + .../models/RegisteredServerArray.java | 55 + .../RegisteredServerCreateParameters.java | 261 ++ .../storagesync/models/RegisteredServers.java | 188 + .../RegisteredServersCreateHeaders.java | 128 + .../RegisteredServersCreateResponse.java | 38 + .../RegisteredServersDeleteHeaders.java | 102 + .../RegisteredServersDeleteResponse.java | 30 + .../models/RegisteredServersGetHeaders.java | 76 + .../models/RegisteredServersGetResponse.java | 38 + ...erversListByStorageSyncServiceHeaders.java | 78 + ...rversListByStorageSyncServiceResponse.java | 37 + ...gisteredServersTriggerRolloverHeaders.java | 102 + ...isteredServersTriggerRolloverResponse.java | 31 + .../storagesync/models/RestoreFileSpec.java | 76 + .../storagesync/models/ServerEndpoint.java | 482 +++ .../models/ServerEndpointArray.java | 55 + ...ndpointBackgroundDataDownloadActivity.java | 86 + .../ServerEndpointCloudTieringStatus.java | 191 + .../ServerEndpointCreateParameters.java | 316 ++ .../ServerEndpointFilesNotSyncingError.java | 69 + .../models/ServerEndpointHealthState.java | 37 + ...erverEndpointOfflineDataTransferState.java | 41 + .../models/ServerEndpointRecallError.java | 54 + .../models/ServerEndpointRecallStatus.java | 74 + .../ServerEndpointSyncActivityState.java | 37 + .../ServerEndpointSyncActivityStatus.java | 145 + .../models/ServerEndpointSyncMode.java | 43 + .../ServerEndpointSyncSessionStatus.java | 149 + .../models/ServerEndpointSyncStatus.java | 222 ++ .../ServerEndpointUpdateParameters.java | 185 + .../storagesync/models/ServerEndpoints.java | 213 ++ .../models/ServerEndpointsCreateHeaders.java | 128 + .../models/ServerEndpointsCreateResponse.java | 38 + .../models/ServerEndpointsDeleteHeaders.java | 102 + .../models/ServerEndpointsDeleteResponse.java | 26 + .../models/ServerEndpointsGetHeaders.java | 76 + .../models/ServerEndpointsGetResponse.java | 37 + ...ServerEndpointsListBySyncGroupHeaders.java | 102 + ...erverEndpointsListBySyncGroupResponse.java | 37 + .../ServerEndpointsRecallActionHeaders.java | 102 + .../ServerEndpointsRecallActionResponse.java | 30 + .../models/ServerEndpointsUpdateHeaders.java | 128 + .../models/ServerEndpointsUpdateResponse.java | 38 + .../models/StorageSyncApiError.java | 43 + .../models/StorageSyncApiErrorException.java | 37 + .../models/StorageSyncInnerErrorDetails.java | 128 + .../models/StorageSyncService.java | 275 ++ .../models/StorageSyncServiceArray.java | 55 + .../StorageSyncServiceCreateParameters.java | 131 + .../StorageSyncServiceUpdateParameters.java | 79 + .../models/StorageSyncServices.java | 194 + .../StorageSyncServicesCreateHeaders.java | 154 + .../StorageSyncServicesCreateResponse.java | 38 + .../StorageSyncServicesDeleteHeaders.java | 154 + .../StorageSyncServicesDeleteResponse.java | 30 + ...SyncServicesGetByResourceGroupHeaders.java | 77 + ...yncServicesGetByResourceGroupResponse.java | 38 + ...yncServicesListByResourceGroupHeaders.java | 77 + ...ncServicesListByResourceGroupResponse.java | 37 + .../StorageSyncServicesListHeaders.java | 76 + .../StorageSyncServicesListResponse.java | 37 + .../StorageSyncServicesUpdateHeaders.java | 154 + .../StorageSyncServicesUpdateResponse.java | 38 + .../storagesync/models/SyncGroup.java | 119 + .../storagesync/models/SyncGroupArray.java | 55 + .../models/SyncGroupCreateParameters.java | 51 + .../storagesync/models/SyncGroups.java | 156 + .../models/SyncGroupsCreateHeaders.java | 76 + .../models/SyncGroupsCreateResponse.java | 37 + .../models/SyncGroupsDeleteHeaders.java | 76 + .../models/SyncGroupsDeleteResponse.java | 26 + .../models/SyncGroupsGetHeaders.java | 76 + .../models/SyncGroupsGetResponse.java | 37 + ...GroupsListByStorageSyncServiceHeaders.java | 76 + ...roupsListByStorageSyncServiceResponse.java | 37 + .../TriggerChangeDetectionParameters.java | 112 + .../models/TriggerRolloverRequest.java | 50 + .../storagesync/models/Workflow.java | 95 + .../storagesync/models/WorkflowArray.java | 55 + .../storagesync/models/WorkflowStatus.java | 43 + .../storagesync/models/Workflows.java | 99 + .../models/WorkflowsAbortHeaders.java | 76 + .../models/WorkflowsAbortResponse.java | 26 + .../models/WorkflowsGetHeaders.java | 76 + .../models/WorkflowsGetResponse.java | 33 + ...kflowsListByStorageSyncServiceHeaders.java | 76 + ...flowsListByStorageSyncServiceResponse.java | 37 + .../storagesync/models/package-info.java | 6 + .../storagesync/package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/storagesync/ci.yml | 33 + sdk/storagesync/pom.xml | 53 + 244 files changed, 36572 insertions(+) create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/CHANGELOG.md create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/README.md create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/pom.xml create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/StoragesyncManager.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/CloudEndpointsClient.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/MicrosoftStorageSync.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/OperationStatusOperationsClient.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/OperationsClient.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/PrivateEndpointConnectionsClient.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/PrivateLinkResourcesClient.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/RegisteredServersClient.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/ServerEndpointsClient.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/StorageSyncServicesClient.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/SyncGroupsClient.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/WorkflowsClient.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CheckNameAvailabilityResultInner.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CloudEndpointInner.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/OperationEntityInner.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/OperationStatusInner.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PostBackupResponseInner.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PrivateEndpointConnectionInner.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PrivateLinkResourceListResultInner.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/RegisteredServerInner.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/ServerEndpointInner.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/StorageSyncServiceInner.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/SyncGroupInner.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/WorkflowInner.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/package-info.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/package-info.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CheckNameAvailabilityResultImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointsClientImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointsImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/MicrosoftStorageSyncBuilder.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/MicrosoftStorageSyncImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationEntityImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationStatusImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationStatusOperationsClientImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationStatusOperationsImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationsClientImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationsImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PostBackupResponseImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateLinkResourceListResultImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateLinkResourcesClientImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateLinkResourcesImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/RegisteredServerImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/RegisteredServersClientImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/RegisteredServersImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointsClientImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointsImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/StorageSyncServiceImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/StorageSyncServicesClientImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/StorageSyncServicesImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/SyncGroupImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/SyncGroupsClientImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/SyncGroupsImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/Utils.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/WorkflowImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/WorkflowsClientImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/WorkflowsImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/package-info.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/BackupRequest.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ChangeDetectionMode.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CheckNameAvailabilityParameters.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CheckNameAvailabilityResult.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpoint.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointArray.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationActivity.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationActivityState.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationStatus.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationTotalCountsState.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointCreateParameters.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointLastChangeEnumerationStatus.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpoints.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsCreateHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsCreateResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsDeleteHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsDeleteResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsGetHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsGetResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsListBySyncGroupHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsListBySyncGroupResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostBackupHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostBackupResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostRestoreHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostRestoreResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreBackupHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreBackupResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreRestoreHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreRestoreResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsRestoreheartbeatHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsRestoreheartbeatResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsTriggerChangeDetectionHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsTriggerChangeDetectionResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringCachePerformance.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringDatePolicyStatus.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringFilesNotTiering.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringSpaceSavings.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringVolumeFreeSpacePolicyStatus.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/FeatureStatus.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/FilesNotTieringError.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/IncomingTrafficPolicy.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/InitialDownloadPolicy.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/InitialUploadPolicy.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/LocalCacheMode.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/NameAvailabilityReason.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationDirection.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationDisplayInfo.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationEntity.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationEntityListResult.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationProperties.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationResourceMetricSpecification.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationResourceMetricSpecificationDimension.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationResourceServiceSpecification.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatus.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatusOperations.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatusOperationsGetHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatusOperationsGetResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Operations.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListNextHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListNextResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PostBackupResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PostRestoreRequest.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PreRestoreRequest.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpoint.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnection.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionListResult.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionProvisioningState.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnections.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsCreateHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsCreateResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsDeleteHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsDeleteResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsListByStorageSyncServiceHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsListByStorageSyncServiceResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointServiceConnectionStatus.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkResource.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkResourceListResult.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkResources.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkServiceConnectionState.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Reason.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RecallActionParameters.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServer.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServerAgentVersionStatus.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServerArray.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServerCreateParameters.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServers.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersCreateHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersCreateResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersDeleteHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersDeleteResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersGetHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersGetResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersListByStorageSyncServiceHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersListByStorageSyncServiceResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersTriggerRolloverHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersTriggerRolloverResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RestoreFileSpec.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpoint.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointArray.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointBackgroundDataDownloadActivity.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointCloudTieringStatus.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointCreateParameters.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointFilesNotSyncingError.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointHealthState.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointOfflineDataTransferState.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointRecallError.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointRecallStatus.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncActivityState.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncActivityStatus.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncMode.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncSessionStatus.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncStatus.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointUpdateParameters.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpoints.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsCreateHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsCreateResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsDeleteHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsDeleteResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsGetHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsGetResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsListBySyncGroupHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsListBySyncGroupResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsRecallActionHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsRecallActionResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsUpdateHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsUpdateResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncApiError.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncApiErrorException.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncInnerErrorDetails.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncService.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServiceArray.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServiceCreateParameters.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServiceUpdateParameters.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServices.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesCreateHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesCreateResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesDeleteHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesDeleteResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesGetByResourceGroupHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesGetByResourceGroupResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListByResourceGroupHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListByResourceGroupResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesUpdateHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesUpdateResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroup.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupArray.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupCreateParameters.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroups.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsCreateHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsCreateResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsDeleteHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsDeleteResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsGetHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsGetResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsListByStorageSyncServiceHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsListByStorageSyncServiceResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/TriggerChangeDetectionParameters.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/TriggerRolloverRequest.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Workflow.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowArray.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowStatus.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Workflows.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsAbortHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsAbortResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsGetHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsGetResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsListByStorageSyncServiceHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsListByStorageSyncServiceResponse.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/package-info.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/package-info.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/module-info.java create mode 100644 sdk/storagesync/ci.yml create mode 100644 sdk/storagesync/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index ad3db2b85e18a..9c9a848eb926a 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -298,6 +298,7 @@ com.azure.resourcemanager:azure-resourcemanager-maps;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-botservice;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-recoveryservicesbackup;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-deviceprovisioningservices;1.0.0;1.1.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-storagesync;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index 0524f27a56a10..473b3adf9a5e5 100644 --- a/pom.xml +++ b/pom.xml @@ -798,6 +798,7 @@ sdk/storage sdk/storagecache sdk/storageimportexport + sdk/storagesync sdk/streamanalytics sdk/subscription sdk/support diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/CHANGELOG.md b/sdk/storagesync/azure-resourcemanager-storagesync/CHANGELOG.md new file mode 100644 index 0000000000000..f515bbc105eec --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-06-10) + +- Azure Resource Manager storagesync client library for Java. This package contains Microsoft Azure SDK for storagesync Management SDK. Microsoft Storage Sync Service API. Package tag package-2020-09-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/README.md b/sdk/storagesync/azure-resourcemanager-storagesync/README.md new file mode 100644 index 0000000000000..ea81b8b8901c1 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/README.md @@ -0,0 +1,101 @@ +# Azure Resource Manager storagesync client library for Java + +Azure Resource Manager storagesync client library for Java. + +This package contains Microsoft Azure SDK for storagesync Management SDK. Microsoft Storage Sync Service API. Package tag package-2020-09-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-storagesync;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-storagesync + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +StoragesyncManager manager = StoragesyncManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/pom.xml b/sdk/storagesync/azure-resourcemanager-storagesync/pom.xml new file mode 100644 index 0000000000000..c7c54e61a3e9f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/pom.xml @@ -0,0 +1,86 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-storagesync + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for storagesync Management + This package contains Microsoft Azure SDK for storagesync Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Storage Sync Service API. Package tag package-2020-09-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 + + + + + com.azure + azure-core + 1.17.0 + + + com.azure + azure-core-management + 1.3.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + + diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/StoragesyncManager.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/StoragesyncManager.java new file mode 100644 index 0000000000000..b4b97cb3ec111 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/StoragesyncManager.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync; + +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.policy.AddDatePolicy; +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.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.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.fluent.MicrosoftStorageSync; +import com.azure.resourcemanager.storagesync.implementation.CloudEndpointsImpl; +import com.azure.resourcemanager.storagesync.implementation.MicrosoftStorageSyncBuilder; +import com.azure.resourcemanager.storagesync.implementation.OperationStatusOperationsImpl; +import com.azure.resourcemanager.storagesync.implementation.OperationsImpl; +import com.azure.resourcemanager.storagesync.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.storagesync.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.storagesync.implementation.RegisteredServersImpl; +import com.azure.resourcemanager.storagesync.implementation.ServerEndpointsImpl; +import com.azure.resourcemanager.storagesync.implementation.StorageSyncServicesImpl; +import com.azure.resourcemanager.storagesync.implementation.SyncGroupsImpl; +import com.azure.resourcemanager.storagesync.implementation.WorkflowsImpl; +import com.azure.resourcemanager.storagesync.models.CloudEndpoints; +import com.azure.resourcemanager.storagesync.models.OperationStatusOperations; +import com.azure.resourcemanager.storagesync.models.Operations; +import com.azure.resourcemanager.storagesync.models.PrivateEndpointConnections; +import com.azure.resourcemanager.storagesync.models.PrivateLinkResources; +import com.azure.resourcemanager.storagesync.models.RegisteredServers; +import com.azure.resourcemanager.storagesync.models.ServerEndpoints; +import com.azure.resourcemanager.storagesync.models.StorageSyncServices; +import com.azure.resourcemanager.storagesync.models.SyncGroups; +import com.azure.resourcemanager.storagesync.models.Workflows; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to StoragesyncManager. Microsoft Storage Sync Service API. */ +public final class StoragesyncManager { + private Operations operations; + + private StorageSyncServices storageSyncServices; + + private PrivateLinkResources privateLinkResources; + + private PrivateEndpointConnections privateEndpointConnections; + + private SyncGroups syncGroups; + + private CloudEndpoints cloudEndpoints; + + private ServerEndpoints serverEndpoints; + + private RegisteredServers registeredServers; + + private Workflows workflows; + + private OperationStatusOperations operationStatusOperations; + + private final MicrosoftStorageSync clientObject; + + private StoragesyncManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new MicrosoftStorageSyncBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of storagesync service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the storagesync service API instance. + */ + public static StoragesyncManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create StoragesyncManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new StoragesyncManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of storagesync service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the storagesync service API instance. + */ + public StoragesyncManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.storagesync") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.addAll(this.policies); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new StoragesyncManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of StorageSyncServices. */ + public StorageSyncServices storageSyncServices() { + if (this.storageSyncServices == null) { + this.storageSyncServices = new StorageSyncServicesImpl(clientObject.getStorageSyncServices(), this); + } + return storageSyncServices; + } + + /** @return Resource collection API of PrivateLinkResources. */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** @return Resource collection API of SyncGroups. */ + public SyncGroups syncGroups() { + if (this.syncGroups == null) { + this.syncGroups = new SyncGroupsImpl(clientObject.getSyncGroups(), this); + } + return syncGroups; + } + + /** @return Resource collection API of CloudEndpoints. */ + public CloudEndpoints cloudEndpoints() { + if (this.cloudEndpoints == null) { + this.cloudEndpoints = new CloudEndpointsImpl(clientObject.getCloudEndpoints(), this); + } + return cloudEndpoints; + } + + /** @return Resource collection API of ServerEndpoints. */ + public ServerEndpoints serverEndpoints() { + if (this.serverEndpoints == null) { + this.serverEndpoints = new ServerEndpointsImpl(clientObject.getServerEndpoints(), this); + } + return serverEndpoints; + } + + /** @return Resource collection API of RegisteredServers. */ + public RegisteredServers registeredServers() { + if (this.registeredServers == null) { + this.registeredServers = new RegisteredServersImpl(clientObject.getRegisteredServers(), this); + } + return registeredServers; + } + + /** @return Resource collection API of Workflows. */ + public Workflows workflows() { + if (this.workflows == null) { + this.workflows = new WorkflowsImpl(clientObject.getWorkflows(), this); + } + return workflows; + } + + /** @return Resource collection API of OperationStatusOperations. */ + public OperationStatusOperations operationStatusOperations() { + if (this.operationStatusOperations == null) { + this.operationStatusOperations = + new OperationStatusOperationsImpl(clientObject.getOperationStatusOperations(), this); + } + return operationStatusOperations; + } + + /** + * @return Wrapped service client MicrosoftStorageSync providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public MicrosoftStorageSync serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/CloudEndpointsClient.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/CloudEndpointsClient.java new file mode 100644 index 0000000000000..a5b3eaf0b11cf --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/CloudEndpointsClient.java @@ -0,0 +1,758 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storagesync.fluent.models.CloudEndpointInner; +import com.azure.resourcemanager.storagesync.fluent.models.PostBackupResponseInner; +import com.azure.resourcemanager.storagesync.models.BackupRequest; +import com.azure.resourcemanager.storagesync.models.CloudEndpointCreateParameters; +import com.azure.resourcemanager.storagesync.models.CloudEndpointsGetResponse; +import com.azure.resourcemanager.storagesync.models.CloudEndpointsRestoreheartbeatResponse; +import com.azure.resourcemanager.storagesync.models.PostRestoreRequest; +import com.azure.resourcemanager.storagesync.models.PreRestoreRequest; +import com.azure.resourcemanager.storagesync.models.TriggerChangeDetectionParameters; + +/** An instance of this class provides access to all the operations defined in CloudEndpointsClient. */ +public interface CloudEndpointsClient { + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CloudEndpointInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + CloudEndpointCreateParameters parameters); + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, CloudEndpointInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + CloudEndpointCreateParameters parameters, + Context context); + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudEndpointInner create( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + CloudEndpointCreateParameters parameters); + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudEndpointInner create( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + CloudEndpointCreateParameters parameters, + Context context); + + /** + * Get a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given CloudEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudEndpointInner get( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName); + + /** + * Get a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given CloudEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudEndpointsGetResponse getWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context); + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName); + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context); + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, String syncGroupName, String cloudEndpointName); + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context); + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudEndpoint List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName); + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudEndpoint List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context); + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPreBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters); + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPreBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context); + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 preBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters); + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 preBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context); + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PostBackupResponseInner> beginPostBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters); + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PostBackupResponseInner> beginPostBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context); + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PostBackupResponseInner postBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters); + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PostBackupResponseInner postBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context); + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPreRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters); + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPreRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters, + Context context); + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 preRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters); + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 preRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters, + Context context); + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 restoreheartbeat( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName); + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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) + CloudEndpointsRestoreheartbeatResponse restoreheartbeatWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context); + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPostRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters); + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginPostRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters, + Context context); + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 postRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters); + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 postRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters, + Context context); + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginTriggerChangeDetection( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters); + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginTriggerChangeDetection( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters, + Context context); + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 triggerChangeDetection( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters); + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 triggerChangeDetection( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters, + Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/MicrosoftStorageSync.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/MicrosoftStorageSync.java new file mode 100644 index 0000000000000..a948cc40b64bf --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/MicrosoftStorageSync.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for MicrosoftStorageSync class. */ +public interface MicrosoftStorageSync { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the StorageSyncServicesClient object to access its operations. + * + * @return the StorageSyncServicesClient object. + */ + StorageSyncServicesClient getStorageSyncServices(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the SyncGroupsClient object to access its operations. + * + * @return the SyncGroupsClient object. + */ + SyncGroupsClient getSyncGroups(); + + /** + * Gets the CloudEndpointsClient object to access its operations. + * + * @return the CloudEndpointsClient object. + */ + CloudEndpointsClient getCloudEndpoints(); + + /** + * Gets the ServerEndpointsClient object to access its operations. + * + * @return the ServerEndpointsClient object. + */ + ServerEndpointsClient getServerEndpoints(); + + /** + * Gets the RegisteredServersClient object to access its operations. + * + * @return the RegisteredServersClient object. + */ + RegisteredServersClient getRegisteredServers(); + + /** + * Gets the WorkflowsClient object to access its operations. + * + * @return the WorkflowsClient object. + */ + WorkflowsClient getWorkflows(); + + /** + * Gets the OperationStatusOperationsClient object to access its operations. + * + * @return the OperationStatusOperationsClient object. + */ + OperationStatusOperationsClient getOperationStatusOperations(); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/OperationStatusOperationsClient.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/OperationStatusOperationsClient.java new file mode 100644 index 0000000000000..c25d4f84b3d4d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/OperationStatusOperationsClient.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.storagesync.models.OperationStatusOperationsGetResponse; + +/** An instance of this class provides access to all the operations defined in OperationStatusOperationsClient. */ +public interface OperationStatusOperationsClient { + /** + * Get Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param locationName The desired region to obtain information from. + * @param workflowId workflow Id. + * @param operationId operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get(String resourceGroupName, String locationName, String workflowId, String operationId); + + /** + * Get Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param locationName The desired region to obtain information from. + * @param workflowId workflow Id. + * @param operationId operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusOperationsGetResponse getWithResponse( + String resourceGroupName, String locationName, String workflowId, String operationId, Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/OperationsClient.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/OperationsClient.java new file mode 100644 index 0000000000000..1baa94236002f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.fluent.models.OperationEntityInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of storage sync operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of storage sync operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/PrivateEndpointConnectionsClient.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..8ad7450c8ea8e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.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 storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storage sync service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName); + + /** + * Gets the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storage sync service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName, Context context); + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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) + SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties); + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties 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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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) + SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context); + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties); + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties 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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context); + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, String privateEndpointConnectionName, Context context); + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName); + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/PrivateLinkResourcesClient.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..fa4b345e5bd9e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.fluent.models.PrivateLinkResourceListResultInner; + +/** 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 storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 storage sync service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceListResultInner listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName); + + /** + * Gets the private link resources that need to be created for a storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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 storage sync service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByStorageSyncServiceWithResponse( + String resourceGroupName, String storageSyncServiceName, Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/RegisteredServersClient.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/RegisteredServersClient.java new file mode 100644 index 0000000000000..0b1c9d0357c09 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/RegisteredServersClient.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storagesync.fluent.models.RegisteredServerInner; +import com.azure.resourcemanager.storagesync.models.RegisteredServerCreateParameters; +import com.azure.resourcemanager.storagesync.models.RegisteredServersGetResponse; +import com.azure.resourcemanager.storagesync.models.TriggerRolloverRequest; + +/** An instance of this class provides access to all the operations defined in RegisteredServersClient. */ +public interface RegisteredServersClient { + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName); + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context); + + /** + * Get a given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegisteredServerInner get(String resourceGroupName, String storageSyncServiceName, String serverId); + + /** + * Get a given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegisteredServersGetResponse getWithResponse( + String resourceGroupName, String storageSyncServiceName, String serverId, Context context); + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registered Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RegisteredServerInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + RegisteredServerCreateParameters parameters); + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registered Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RegisteredServerInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + RegisteredServerCreateParameters parameters, + Context context); + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registered Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegisteredServerInner create( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + RegisteredServerCreateParameters parameters); + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registered Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RegisteredServerInner create( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + RegisteredServerCreateParameters parameters, + Context context); + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String storageSyncServiceName, String serverId); + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String storageSyncServiceName, String serverId, Context context); + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, String serverId); + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, String serverId, Context context); + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginTriggerRollover( + String resourceGroupName, String storageSyncServiceName, String serverId, TriggerRolloverRequest parameters); + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginTriggerRollover( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + TriggerRolloverRequest parameters, + Context context); + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 triggerRollover( + String resourceGroupName, String storageSyncServiceName, String serverId, TriggerRolloverRequest parameters); + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 triggerRollover( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + TriggerRolloverRequest parameters, + Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/ServerEndpointsClient.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/ServerEndpointsClient.java new file mode 100644 index 0000000000000..93bce7111e510 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/ServerEndpointsClient.java @@ -0,0 +1,459 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storagesync.fluent.models.ServerEndpointInner; +import com.azure.resourcemanager.storagesync.models.RecallActionParameters; +import com.azure.resourcemanager.storagesync.models.ServerEndpointCreateParameters; +import com.azure.resourcemanager.storagesync.models.ServerEndpointUpdateParameters; +import com.azure.resourcemanager.storagesync.models.ServerEndpointsGetResponse; + +/** An instance of this class provides access to all the operations defined in ServerEndpointsClient. */ +public interface ServerEndpointsClient { + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServerEndpointInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointCreateParameters parameters); + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServerEndpointInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointCreateParameters parameters, + Context context); + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerEndpointInner create( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointCreateParameters parameters); + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerEndpointInner create( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointCreateParameters parameters, + Context context); + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServerEndpointInner> beginUpdate( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointUpdateParameters parameters); + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServerEndpointInner> beginUpdate( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointUpdateParameters parameters, + Context context); + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerEndpointInner update( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointUpdateParameters parameters); + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerEndpointInner update( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName); + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerEndpointInner update( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointUpdateParameters parameters, + Context context); + + /** + * Get a ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerEndpointInner get( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName); + + /** + * Get a ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerEndpointsGetResponse getWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + Context context); + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName); + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + Context context); + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, String syncGroupName, String serverEndpointName); + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + Context context); + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName); + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context); + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRecallAction( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters); + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRecallAction( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters, + Context context); + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 recallAction( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters); + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 recallAction( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters, + Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/StorageSyncServicesClient.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/StorageSyncServicesClient.java new file mode 100644 index 0000000000000..c25fc54e4034e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/StorageSyncServicesClient.java @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.storagesync.fluent.models.StorageSyncServiceInner; +import com.azure.resourcemanager.storagesync.models.CheckNameAvailabilityParameters; +import com.azure.resourcemanager.storagesync.models.StorageSyncServiceCreateParameters; +import com.azure.resourcemanager.storagesync.models.StorageSyncServiceUpdateParameters; +import com.azure.resourcemanager.storagesync.models.StorageSyncServicesGetByResourceGroupResponse; + +/** An instance of this class provides access to all the operations defined in StorageSyncServicesClient. */ +public interface StorageSyncServicesClient { + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResultInner checkNameAvailability( + String locationName, CheckNameAvailabilityParameters parameters); + + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String locationName, CheckNameAvailabilityParameters parameters, Context context); + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, StorageSyncServiceInner> beginCreate( + String resourceGroupName, String storageSyncServiceName, StorageSyncServiceCreateParameters parameters); + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, StorageSyncServiceInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + StorageSyncServiceCreateParameters parameters, + Context context); + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageSyncServiceInner create( + String resourceGroupName, String storageSyncServiceName, StorageSyncServiceCreateParameters parameters); + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageSyncServiceInner create( + String resourceGroupName, + String storageSyncServiceName, + StorageSyncServiceCreateParameters parameters, + Context context); + + /** + * Get a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given StorageSyncService. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageSyncServiceInner getByResourceGroup(String resourceGroupName, String storageSyncServiceName); + + /** + * Get a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given StorageSyncService. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageSyncServicesGetByResourceGroupResponse getByResourceGroupWithResponse( + String resourceGroupName, String storageSyncServiceName, Context context); + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, StorageSyncServiceInner> beginUpdate( + String resourceGroupName, String storageSyncServiceName, StorageSyncServiceUpdateParameters parameters); + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, StorageSyncServiceInner> beginUpdate( + String resourceGroupName, + String storageSyncServiceName, + StorageSyncServiceUpdateParameters parameters, + Context context); + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageSyncServiceInner update( + String resourceGroupName, String storageSyncServiceName, StorageSyncServiceUpdateParameters parameters); + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageSyncServiceInner update(String resourceGroupName, String storageSyncServiceName); + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageSyncServiceInner update( + String resourceGroupName, + String storageSyncServiceName, + StorageSyncServiceUpdateParameters parameters, + Context context); + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String storageSyncServiceName); + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String storageSyncServiceName, Context context); + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName); + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, Context context); + + /** + * Get a StorageSyncService list by Resource group name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by Resource group name. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get a StorageSyncService list by Resource group name. + * + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by Resource group name. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a StorageSyncService list by subscription. + * + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get a StorageSyncService list by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/SyncGroupsClient.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/SyncGroupsClient.java new file mode 100644 index 0000000000000..531e6646b9167 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/SyncGroupsClient.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.fluent.models.SyncGroupInner; +import com.azure.resourcemanager.storagesync.models.SyncGroupCreateParameters; +import com.azure.resourcemanager.storagesync.models.SyncGroupsCreateResponse; +import com.azure.resourcemanager.storagesync.models.SyncGroupsDeleteResponse; +import com.azure.resourcemanager.storagesync.models.SyncGroupsGetResponse; + +/** An instance of this class provides access to all the operations defined in SyncGroupsClient. */ +public interface SyncGroupsClient { + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SyncGroup List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByStorageSyncService(String resourceGroupName, String storageSyncServiceName); + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SyncGroup List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context); + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param parameters Sync Group Body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sync Group object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncGroupInner create( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + SyncGroupCreateParameters parameters); + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param parameters Sync Group Body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sync Group object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncGroupsCreateResponse createWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + SyncGroupCreateParameters parameters, + Context context); + + /** + * Get a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given SyncGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncGroupInner get(String resourceGroupName, String storageSyncServiceName, String syncGroupName); + + /** + * Get a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given SyncGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncGroupsGetResponse getWithResponse( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context); + + /** + * Delete a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, String syncGroupName); + + /** + * Delete a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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) + SyncGroupsDeleteResponse deleteWithResponse( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/WorkflowsClient.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/WorkflowsClient.java new file mode 100644 index 0000000000000..31d6cd23d0b09 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/WorkflowsClient.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.fluent.models.WorkflowInner; +import com.azure.resourcemanager.storagesync.models.WorkflowsAbortResponse; +import com.azure.resourcemanager.storagesync.models.WorkflowsGetResponse; + +/** An instance of this class provides access to all the operations defined in WorkflowsClient. */ +public interface WorkflowsClient { + /** + * Get a Workflow List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workflow List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByStorageSyncService(String resourceGroupName, String storageSyncServiceName); + + /** + * Get a Workflow List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workflow List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context); + + /** + * Get Workflows resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflows resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkflowInner get(String resourceGroupName, String storageSyncServiceName, String workflowId); + + /** + * Get Workflows resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflows resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkflowsGetResponse getWithResponse( + String resourceGroupName, String storageSyncServiceName, String workflowId, Context context); + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 abort(String resourceGroupName, String storageSyncServiceName, String workflowId); + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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) + WorkflowsAbortResponse abortWithResponse( + String resourceGroupName, String storageSyncServiceName, String workflowId, Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CheckNameAvailabilityResultInner.java new file mode 100644 index 0000000000000..aa404d45b32de --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CheckNameAvailabilityResultInner.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.models.NameAvailabilityReason; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CheckNameAvailability operation response. */ +@Immutable +public final class CheckNameAvailabilityResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityResultInner.class); + + /* + * Gets a boolean value that indicates whether the name is available for + * you to use. If true, the name is available. If false, the name has + * already been taken or invalid and cannot be used. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /* + * Gets the reason that a Storage Sync Service name could not be used. The + * Reason element is only returned if NameAvailable is false. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private NameAvailabilityReason reason; + + /* + * Gets an error message explaining the Reason value in more detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the nameAvailable property: Gets a boolean value that indicates whether the name is available for you to use. + * If true, the name is available. If false, the name has already been taken or invalid and cannot be used. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason property: Gets the reason that a Storage Sync Service name could not be used. The Reason element + * is only returned if NameAvailable is false. + * + * @return the reason value. + */ + public NameAvailabilityReason reason() { + return this.reason; + } + + /** + * Get the message property: Gets an error message explaining the Reason value in more detail. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CloudEndpointInner.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CloudEndpointInner.java new file mode 100644 index 0000000000000..278465eb05db0 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CloudEndpointInner.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.models.CloudEndpointChangeEnumerationStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cloud Endpoint object. */ +@JsonFlatten +@Fluent +public class CloudEndpointInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointInner.class); + + /* + * Storage Account Resource Id + */ + @JsonProperty(value = "properties.storageAccountResourceId") + private String storageAccountResourceId; + + /* + * Azure file share name + */ + @JsonProperty(value = "properties.azureFileShareName") + private String azureFileShareName; + + /* + * Storage Account Tenant Id + */ + @JsonProperty(value = "properties.storageAccountTenantId") + private String storageAccountTenantId; + + /* + * Partnership Id + */ + @JsonProperty(value = "properties.partnershipId") + private String partnershipId; + + /* + * Friendly Name + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /* + * Backup Enabled + */ + @JsonProperty(value = "properties.backupEnabled", access = JsonProperty.Access.WRITE_ONLY) + private String backupEnabled; + + /* + * CloudEndpoint Provisioning State + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /* + * CloudEndpoint lastWorkflowId + */ + @JsonProperty(value = "properties.lastWorkflowId") + private String lastWorkflowId; + + /* + * Resource Last Operation Name + */ + @JsonProperty(value = "properties.lastOperationName") + private String lastOperationName; + + /* + * Cloud endpoint change enumeration status + */ + @JsonProperty(value = "properties.changeEnumerationStatus", access = JsonProperty.Access.WRITE_ONLY) + private CloudEndpointChangeEnumerationStatus changeEnumerationStatus; + + /** + * Get the storageAccountResourceId property: Storage Account Resource Id. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set the storageAccountResourceId property: Storage Account Resource Id. + * + * @param storageAccountResourceId the storageAccountResourceId value to set. + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get the azureFileShareName property: Azure file share name. + * + * @return the azureFileShareName value. + */ + public String azureFileShareName() { + return this.azureFileShareName; + } + + /** + * Set the azureFileShareName property: Azure file share name. + * + * @param azureFileShareName the azureFileShareName value to set. + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withAzureFileShareName(String azureFileShareName) { + this.azureFileShareName = azureFileShareName; + return this; + } + + /** + * Get the storageAccountTenantId property: Storage Account Tenant Id. + * + * @return the storageAccountTenantId value. + */ + public String storageAccountTenantId() { + return this.storageAccountTenantId; + } + + /** + * Set the storageAccountTenantId property: Storage Account Tenant Id. + * + * @param storageAccountTenantId the storageAccountTenantId value to set. + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withStorageAccountTenantId(String storageAccountTenantId) { + this.storageAccountTenantId = storageAccountTenantId; + return this; + } + + /** + * Get the partnershipId property: Partnership Id. + * + * @return the partnershipId value. + */ + public String partnershipId() { + return this.partnershipId; + } + + /** + * Set the partnershipId property: Partnership Id. + * + * @param partnershipId the partnershipId value to set. + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withPartnershipId(String partnershipId) { + this.partnershipId = partnershipId; + return this; + } + + /** + * Get the friendlyName property: Friendly Name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly Name. + * + * @param friendlyName the friendlyName value to set. + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the backupEnabled property: Backup Enabled. + * + * @return the backupEnabled value. + */ + public String backupEnabled() { + return this.backupEnabled; + } + + /** + * Get the provisioningState property: CloudEndpoint Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: CloudEndpoint Provisioning State. + * + * @param provisioningState the provisioningState value to set. + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the lastWorkflowId property: CloudEndpoint lastWorkflowId. + * + * @return the lastWorkflowId value. + */ + public String lastWorkflowId() { + return this.lastWorkflowId; + } + + /** + * Set the lastWorkflowId property: CloudEndpoint lastWorkflowId. + * + * @param lastWorkflowId the lastWorkflowId value to set. + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withLastWorkflowId(String lastWorkflowId) { + this.lastWorkflowId = lastWorkflowId; + return this; + } + + /** + * Get the lastOperationName property: Resource Last Operation Name. + * + * @return the lastOperationName value. + */ + public String lastOperationName() { + return this.lastOperationName; + } + + /** + * Set the lastOperationName property: Resource Last Operation Name. + * + * @param lastOperationName the lastOperationName value to set. + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withLastOperationName(String lastOperationName) { + this.lastOperationName = lastOperationName; + return this; + } + + /** + * Get the changeEnumerationStatus property: Cloud endpoint change enumeration status. + * + * @return the changeEnumerationStatus value. + */ + public CloudEndpointChangeEnumerationStatus changeEnumerationStatus() { + return this.changeEnumerationStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (changeEnumerationStatus() != null) { + changeEnumerationStatus().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/OperationEntityInner.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/OperationEntityInner.java new file mode 100644 index 0000000000000..32701fcd0e118 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/OperationEntityInner.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.models.OperationDisplayInfo; +import com.azure.resourcemanager.storagesync.models.OperationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The operation supported by storage sync. */ +@Fluent +public final class OperationEntityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationEntityInner.class); + + /* + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The operation supported by storage sync. + */ + @JsonProperty(value = "display") + private OperationDisplayInfo display; + + /* + * The origin. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Properties of the operations resource. + */ + @JsonProperty(value = "properties") + private OperationProperties properties; + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set. + * @return the OperationEntityInner object itself. + */ + public OperationEntityInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: The operation supported by storage sync. + * + * @return the display value. + */ + public OperationDisplayInfo display() { + return this.display; + } + + /** + * Set the display property: The operation supported by storage sync. + * + * @param display the display value to set. + * @return the OperationEntityInner object itself. + */ + public OperationEntityInner withDisplay(OperationDisplayInfo display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The origin. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: The origin. + * + * @param origin the origin value to set. + * @return the OperationEntityInner object itself. + */ + public OperationEntityInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: Properties of the operations resource. + * + * @return the properties value. + */ + public OperationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the operations resource. + * + * @param properties the properties value to set. + * @return the OperationEntityInner object itself. + */ + public OperationEntityInner withProperties(OperationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/OperationStatusInner.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/OperationStatusInner.java new file mode 100644 index 0000000000000..eb881b412e5e2 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/OperationStatusInner.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.models.StorageSyncApiError; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Operation status object. */ +@Immutable +public final class OperationStatusInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusInner.class); + + /* + * Operation Id + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Operation status + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * Start time of the operation + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * End time of the operation + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTime; + + /* + * Error details. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private StorageSyncApiError error; + + /** + * Get the name property: Operation Id. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the startTime property: Start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: End time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the error property: Error details. + * + * @return the error value. + */ + public StorageSyncApiError error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PostBackupResponseInner.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PostBackupResponseInner.java new file mode 100644 index 0000000000000..8646663c4cbea --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PostBackupResponseInner.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Post Backup Response. */ +@JsonFlatten +@Immutable +public class PostBackupResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PostBackupResponseInner.class); + + /* + * cloud endpoint Name. + */ + @JsonProperty(value = "backupMetadata.cloudEndpointName", access = JsonProperty.Access.WRITE_ONLY) + private String cloudEndpointName; + + /** + * Get the cloudEndpointName property: cloud endpoint Name. + * + * @return the cloudEndpointName value. + */ + public String cloudEndpointName() { + return this.cloudEndpointName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PrivateEndpointConnectionInner.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..d2571acab2bac --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.models.PrivateEndpoint; +import com.azure.resourcemanager.storagesync.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.storagesync.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint Connection resource. */ +@JsonFlatten +@Fluent +public class PrivateEndpointConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * The resource of private end point. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner 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 PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PrivateLinkResourceListResultInner.java new file mode 100644 index 0000000000000..3f4d46aa78afc --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PrivateLinkResourceListResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.models.PrivateLinkResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResultInner.class); + + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResultInner object itself. + */ + public PrivateLinkResourceListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/RegisteredServerInner.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/RegisteredServerInner.java new file mode 100644 index 0000000000000..290a3fc2c749d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/RegisteredServerInner.java @@ -0,0 +1,594 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.models.RegisteredServerAgentVersionStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Registered Server resource. */ +@JsonFlatten +@Fluent +public class RegisteredServerInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegisteredServerInner.class); + + /* + * Registered Server Certificate + */ + @JsonProperty(value = "properties.serverCertificate") + private String serverCertificate; + + /* + * Registered Server Agent Version + */ + @JsonProperty(value = "properties.agentVersion") + private String agentVersion; + + /* + * Registered Server Agent Version Status + */ + @JsonProperty(value = "properties.agentVersionStatus", access = JsonProperty.Access.WRITE_ONLY) + private RegisteredServerAgentVersionStatus agentVersionStatus; + + /* + * Registered Server Agent Version Expiration Date + */ + @JsonProperty(value = "properties.agentVersionExpirationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime agentVersionExpirationDate; + + /* + * Registered Server OS Version + */ + @JsonProperty(value = "properties.serverOSVersion") + private String serverOSVersion; + + /* + * Registered Server Management Error Code + */ + @JsonProperty(value = "properties.serverManagementErrorCode") + private Integer serverManagementErrorCode; + + /* + * Registered Server last heart beat + */ + @JsonProperty(value = "properties.lastHeartBeat") + private String lastHeartBeat; + + /* + * Registered Server Provisioning State + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /* + * Registered Server serverRole + */ + @JsonProperty(value = "properties.serverRole") + private String serverRole; + + /* + * Registered Server clusterId + */ + @JsonProperty(value = "properties.clusterId") + private String clusterId; + + /* + * Registered Server clusterName + */ + @JsonProperty(value = "properties.clusterName") + private String clusterName; + + /* + * Registered Server serverId + */ + @JsonProperty(value = "properties.serverId") + private String serverId; + + /* + * Registered Server storageSyncServiceUid + */ + @JsonProperty(value = "properties.storageSyncServiceUid") + private String storageSyncServiceUid; + + /* + * Registered Server lastWorkflowId + */ + @JsonProperty(value = "properties.lastWorkflowId") + private String lastWorkflowId; + + /* + * Resource Last Operation Name + */ + @JsonProperty(value = "properties.lastOperationName") + private String lastOperationName; + + /* + * Resource discoveryEndpointUri + */ + @JsonProperty(value = "properties.discoveryEndpointUri") + private String discoveryEndpointUri; + + /* + * Resource Location + */ + @JsonProperty(value = "properties.resourceLocation") + private String resourceLocation; + + /* + * Service Location + */ + @JsonProperty(value = "properties.serviceLocation") + private String serviceLocation; + + /* + * Friendly Name + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /* + * Management Endpoint Uri + */ + @JsonProperty(value = "properties.managementEndpointUri") + private String managementEndpointUri; + + /* + * Telemetry Endpoint Uri + */ + @JsonProperty(value = "properties.monitoringEndpointUri") + private String monitoringEndpointUri; + + /* + * Monitoring Configuration + */ + @JsonProperty(value = "properties.monitoringConfiguration") + private String monitoringConfiguration; + + /* + * Server name + */ + @JsonProperty(value = "properties.serverName", access = JsonProperty.Access.WRITE_ONLY) + private String serverName; + + /** + * Get the serverCertificate property: Registered Server Certificate. + * + * @return the serverCertificate value. + */ + public String serverCertificate() { + return this.serverCertificate; + } + + /** + * Set the serverCertificate property: Registered Server Certificate. + * + * @param serverCertificate the serverCertificate value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withServerCertificate(String serverCertificate) { + this.serverCertificate = serverCertificate; + return this; + } + + /** + * Get the agentVersion property: Registered Server Agent Version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: Registered Server Agent Version. + * + * @param agentVersion the agentVersion value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the agentVersionStatus property: Registered Server Agent Version Status. + * + * @return the agentVersionStatus value. + */ + public RegisteredServerAgentVersionStatus agentVersionStatus() { + return this.agentVersionStatus; + } + + /** + * Get the agentVersionExpirationDate property: Registered Server Agent Version Expiration Date. + * + * @return the agentVersionExpirationDate value. + */ + public OffsetDateTime agentVersionExpirationDate() { + return this.agentVersionExpirationDate; + } + + /** + * Get the serverOSVersion property: Registered Server OS Version. + * + * @return the serverOSVersion value. + */ + public String serverOSVersion() { + return this.serverOSVersion; + } + + /** + * Set the serverOSVersion property: Registered Server OS Version. + * + * @param serverOSVersion the serverOSVersion value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withServerOSVersion(String serverOSVersion) { + this.serverOSVersion = serverOSVersion; + return this; + } + + /** + * Get the serverManagementErrorCode property: Registered Server Management Error Code. + * + * @return the serverManagementErrorCode value. + */ + public Integer serverManagementErrorCode() { + return this.serverManagementErrorCode; + } + + /** + * Set the serverManagementErrorCode property: Registered Server Management Error Code. + * + * @param serverManagementErrorCode the serverManagementErrorCode value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withServerManagementErrorCode(Integer serverManagementErrorCode) { + this.serverManagementErrorCode = serverManagementErrorCode; + return this; + } + + /** + * Get the lastHeartBeat property: Registered Server last heart beat. + * + * @return the lastHeartBeat value. + */ + public String lastHeartBeat() { + return this.lastHeartBeat; + } + + /** + * Set the lastHeartBeat property: Registered Server last heart beat. + * + * @param lastHeartBeat the lastHeartBeat value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withLastHeartBeat(String lastHeartBeat) { + this.lastHeartBeat = lastHeartBeat; + return this; + } + + /** + * Get the provisioningState property: Registered Server Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Registered Server Provisioning State. + * + * @param provisioningState the provisioningState value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the serverRole property: Registered Server serverRole. + * + * @return the serverRole value. + */ + public String serverRole() { + return this.serverRole; + } + + /** + * Set the serverRole property: Registered Server serverRole. + * + * @param serverRole the serverRole value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withServerRole(String serverRole) { + this.serverRole = serverRole; + return this; + } + + /** + * Get the clusterId property: Registered Server clusterId. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Set the clusterId property: Registered Server clusterId. + * + * @param clusterId the clusterId value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withClusterId(String clusterId) { + this.clusterId = clusterId; + return this; + } + + /** + * Get the clusterName property: Registered Server clusterName. + * + * @return the clusterName value. + */ + public String clusterName() { + return this.clusterName; + } + + /** + * Set the clusterName property: Registered Server clusterName. + * + * @param clusterName the clusterName value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withClusterName(String clusterName) { + this.clusterName = clusterName; + return this; + } + + /** + * Get the serverId property: Registered Server serverId. + * + * @return the serverId value. + */ + public String serverId() { + return this.serverId; + } + + /** + * Set the serverId property: Registered Server serverId. + * + * @param serverId the serverId value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withServerId(String serverId) { + this.serverId = serverId; + return this; + } + + /** + * Get the storageSyncServiceUid property: Registered Server storageSyncServiceUid. + * + * @return the storageSyncServiceUid value. + */ + public String storageSyncServiceUid() { + return this.storageSyncServiceUid; + } + + /** + * Set the storageSyncServiceUid property: Registered Server storageSyncServiceUid. + * + * @param storageSyncServiceUid the storageSyncServiceUid value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withStorageSyncServiceUid(String storageSyncServiceUid) { + this.storageSyncServiceUid = storageSyncServiceUid; + return this; + } + + /** + * Get the lastWorkflowId property: Registered Server lastWorkflowId. + * + * @return the lastWorkflowId value. + */ + public String lastWorkflowId() { + return this.lastWorkflowId; + } + + /** + * Set the lastWorkflowId property: Registered Server lastWorkflowId. + * + * @param lastWorkflowId the lastWorkflowId value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withLastWorkflowId(String lastWorkflowId) { + this.lastWorkflowId = lastWorkflowId; + return this; + } + + /** + * Get the lastOperationName property: Resource Last Operation Name. + * + * @return the lastOperationName value. + */ + public String lastOperationName() { + return this.lastOperationName; + } + + /** + * Set the lastOperationName property: Resource Last Operation Name. + * + * @param lastOperationName the lastOperationName value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withLastOperationName(String lastOperationName) { + this.lastOperationName = lastOperationName; + return this; + } + + /** + * Get the discoveryEndpointUri property: Resource discoveryEndpointUri. + * + * @return the discoveryEndpointUri value. + */ + public String discoveryEndpointUri() { + return this.discoveryEndpointUri; + } + + /** + * Set the discoveryEndpointUri property: Resource discoveryEndpointUri. + * + * @param discoveryEndpointUri the discoveryEndpointUri value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withDiscoveryEndpointUri(String discoveryEndpointUri) { + this.discoveryEndpointUri = discoveryEndpointUri; + return this; + } + + /** + * Get the resourceLocation property: Resource Location. + * + * @return the resourceLocation value. + */ + public String resourceLocation() { + return this.resourceLocation; + } + + /** + * Set the resourceLocation property: Resource Location. + * + * @param resourceLocation the resourceLocation value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withResourceLocation(String resourceLocation) { + this.resourceLocation = resourceLocation; + return this; + } + + /** + * Get the serviceLocation property: Service Location. + * + * @return the serviceLocation value. + */ + public String serviceLocation() { + return this.serviceLocation; + } + + /** + * Set the serviceLocation property: Service Location. + * + * @param serviceLocation the serviceLocation value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withServiceLocation(String serviceLocation) { + this.serviceLocation = serviceLocation; + return this; + } + + /** + * Get the friendlyName property: Friendly Name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly Name. + * + * @param friendlyName the friendlyName value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the managementEndpointUri property: Management Endpoint Uri. + * + * @return the managementEndpointUri value. + */ + public String managementEndpointUri() { + return this.managementEndpointUri; + } + + /** + * Set the managementEndpointUri property: Management Endpoint Uri. + * + * @param managementEndpointUri the managementEndpointUri value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withManagementEndpointUri(String managementEndpointUri) { + this.managementEndpointUri = managementEndpointUri; + return this; + } + + /** + * Get the monitoringEndpointUri property: Telemetry Endpoint Uri. + * + * @return the monitoringEndpointUri value. + */ + public String monitoringEndpointUri() { + return this.monitoringEndpointUri; + } + + /** + * Set the monitoringEndpointUri property: Telemetry Endpoint Uri. + * + * @param monitoringEndpointUri the monitoringEndpointUri value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withMonitoringEndpointUri(String monitoringEndpointUri) { + this.monitoringEndpointUri = monitoringEndpointUri; + return this; + } + + /** + * Get the monitoringConfiguration property: Monitoring Configuration. + * + * @return the monitoringConfiguration value. + */ + public String monitoringConfiguration() { + return this.monitoringConfiguration; + } + + /** + * Set the monitoringConfiguration property: Monitoring Configuration. + * + * @param monitoringConfiguration the monitoringConfiguration value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withMonitoringConfiguration(String monitoringConfiguration) { + this.monitoringConfiguration = monitoringConfiguration; + return this; + } + + /** + * Get the serverName property: Server name. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/ServerEndpointInner.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/ServerEndpointInner.java new file mode 100644 index 0000000000000..5b97795b9cbea --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/ServerEndpointInner.java @@ -0,0 +1,471 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.models.FeatureStatus; +import com.azure.resourcemanager.storagesync.models.InitialDownloadPolicy; +import com.azure.resourcemanager.storagesync.models.InitialUploadPolicy; +import com.azure.resourcemanager.storagesync.models.LocalCacheMode; +import com.azure.resourcemanager.storagesync.models.ServerEndpointCloudTieringStatus; +import com.azure.resourcemanager.storagesync.models.ServerEndpointRecallStatus; +import com.azure.resourcemanager.storagesync.models.ServerEndpointSyncStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Server Endpoint object. */ +@JsonFlatten +@Fluent +public class ServerEndpointInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointInner.class); + + /* + * Server Local path. + */ + @JsonProperty(value = "properties.serverLocalPath") + private String serverLocalPath; + + /* + * Cloud Tiering. + */ + @JsonProperty(value = "properties.cloudTiering") + private FeatureStatus cloudTiering; + + /* + * Level of free space to be maintained by Cloud Tiering if it is enabled. + */ + @JsonProperty(value = "properties.volumeFreeSpacePercent") + private Integer volumeFreeSpacePercent; + + /* + * Tier files older than days. + */ + @JsonProperty(value = "properties.tierFilesOlderThanDays") + private Integer tierFilesOlderThanDays; + + /* + * Friendly Name + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /* + * Server Resource Id. + */ + @JsonProperty(value = "properties.serverResourceId") + private String serverResourceId; + + /* + * ServerEndpoint Provisioning State + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * ServerEndpoint lastWorkflowId + */ + @JsonProperty(value = "properties.lastWorkflowId", access = JsonProperty.Access.WRITE_ONLY) + private String lastWorkflowId; + + /* + * Resource Last Operation Name + */ + @JsonProperty(value = "properties.lastOperationName", access = JsonProperty.Access.WRITE_ONLY) + private String lastOperationName; + + /* + * Server Endpoint sync status + */ + @JsonProperty(value = "properties.syncStatus", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointSyncStatus syncStatus; + + /* + * Offline data transfer + */ + @JsonProperty(value = "properties.offlineDataTransfer") + private FeatureStatus offlineDataTransfer; + + /* + * Offline data transfer storage account resource ID + */ + @JsonProperty( + value = "properties.offlineDataTransferStorageAccountResourceId", + access = JsonProperty.Access.WRITE_ONLY) + private String offlineDataTransferStorageAccountResourceId; + + /* + * Offline data transfer storage account tenant ID + */ + @JsonProperty( + value = "properties.offlineDataTransferStorageAccountTenantId", + access = JsonProperty.Access.WRITE_ONLY) + private String offlineDataTransferStorageAccountTenantId; + + /* + * Offline data transfer share name + */ + @JsonProperty(value = "properties.offlineDataTransferShareName") + private String offlineDataTransferShareName; + + /* + * Cloud tiering status. Only populated if cloud tiering is enabled. + */ + @JsonProperty(value = "properties.cloudTieringStatus", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointCloudTieringStatus cloudTieringStatus; + + /* + * Recall status. Only populated if cloud tiering is enabled. + */ + @JsonProperty(value = "properties.recallStatus", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointRecallStatus recallStatus; + + /* + * Policy for how namespace and files are recalled during FastDr. + */ + @JsonProperty(value = "properties.initialDownloadPolicy") + private InitialDownloadPolicy initialDownloadPolicy; + + /* + * Policy for enabling follow-the-sun business models: link local cache to + * cloud behavior to pre-populate before local access. + */ + @JsonProperty(value = "properties.localCacheMode") + private LocalCacheMode localCacheMode; + + /* + * Policy for how the initial upload sync session is performed. + */ + @JsonProperty(value = "properties.initialUploadPolicy") + private InitialUploadPolicy initialUploadPolicy; + + /* + * Server name + */ + @JsonProperty(value = "properties.serverName", access = JsonProperty.Access.WRITE_ONLY) + private String serverName; + + /** + * Get the serverLocalPath property: Server Local path. + * + * @return the serverLocalPath value. + */ + public String serverLocalPath() { + return this.serverLocalPath; + } + + /** + * Set the serverLocalPath property: Server Local path. + * + * @param serverLocalPath the serverLocalPath value to set. + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withServerLocalPath(String serverLocalPath) { + this.serverLocalPath = serverLocalPath; + return this; + } + + /** + * Get the cloudTiering property: Cloud Tiering. + * + * @return the cloudTiering value. + */ + public FeatureStatus cloudTiering() { + return this.cloudTiering; + } + + /** + * Set the cloudTiering property: Cloud Tiering. + * + * @param cloudTiering the cloudTiering value to set. + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withCloudTiering(FeatureStatus cloudTiering) { + this.cloudTiering = cloudTiering; + return this; + } + + /** + * Get the volumeFreeSpacePercent property: Level of free space to be maintained by Cloud Tiering if it is enabled. + * + * @return the volumeFreeSpacePercent value. + */ + public Integer volumeFreeSpacePercent() { + return this.volumeFreeSpacePercent; + } + + /** + * Set the volumeFreeSpacePercent property: Level of free space to be maintained by Cloud Tiering if it is enabled. + * + * @param volumeFreeSpacePercent the volumeFreeSpacePercent value to set. + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withVolumeFreeSpacePercent(Integer volumeFreeSpacePercent) { + this.volumeFreeSpacePercent = volumeFreeSpacePercent; + return this; + } + + /** + * Get the tierFilesOlderThanDays property: Tier files older than days. + * + * @return the tierFilesOlderThanDays value. + */ + public Integer tierFilesOlderThanDays() { + return this.tierFilesOlderThanDays; + } + + /** + * Set the tierFilesOlderThanDays property: Tier files older than days. + * + * @param tierFilesOlderThanDays the tierFilesOlderThanDays value to set. + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withTierFilesOlderThanDays(Integer tierFilesOlderThanDays) { + this.tierFilesOlderThanDays = tierFilesOlderThanDays; + return this; + } + + /** + * Get the friendlyName property: Friendly Name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly Name. + * + * @param friendlyName the friendlyName value to set. + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the serverResourceId property: Server Resource Id. + * + * @return the serverResourceId value. + */ + public String serverResourceId() { + return this.serverResourceId; + } + + /** + * Set the serverResourceId property: Server Resource Id. + * + * @param serverResourceId the serverResourceId value to set. + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withServerResourceId(String serverResourceId) { + this.serverResourceId = serverResourceId; + return this; + } + + /** + * Get the provisioningState property: ServerEndpoint Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the lastWorkflowId property: ServerEndpoint lastWorkflowId. + * + * @return the lastWorkflowId value. + */ + public String lastWorkflowId() { + return this.lastWorkflowId; + } + + /** + * Get the lastOperationName property: Resource Last Operation Name. + * + * @return the lastOperationName value. + */ + public String lastOperationName() { + return this.lastOperationName; + } + + /** + * Get the syncStatus property: Server Endpoint sync status. + * + * @return the syncStatus value. + */ + public ServerEndpointSyncStatus syncStatus() { + return this.syncStatus; + } + + /** + * Get the offlineDataTransfer property: Offline data transfer. + * + * @return the offlineDataTransfer value. + */ + public FeatureStatus offlineDataTransfer() { + return this.offlineDataTransfer; + } + + /** + * Set the offlineDataTransfer property: Offline data transfer. + * + * @param offlineDataTransfer the offlineDataTransfer value to set. + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withOfflineDataTransfer(FeatureStatus offlineDataTransfer) { + this.offlineDataTransfer = offlineDataTransfer; + return this; + } + + /** + * Get the offlineDataTransferStorageAccountResourceId property: Offline data transfer storage account resource ID. + * + * @return the offlineDataTransferStorageAccountResourceId value. + */ + public String offlineDataTransferStorageAccountResourceId() { + return this.offlineDataTransferStorageAccountResourceId; + } + + /** + * Get the offlineDataTransferStorageAccountTenantId property: Offline data transfer storage account tenant ID. + * + * @return the offlineDataTransferStorageAccountTenantId value. + */ + public String offlineDataTransferStorageAccountTenantId() { + return this.offlineDataTransferStorageAccountTenantId; + } + + /** + * Get the offlineDataTransferShareName property: Offline data transfer share name. + * + * @return the offlineDataTransferShareName value. + */ + public String offlineDataTransferShareName() { + return this.offlineDataTransferShareName; + } + + /** + * Set the offlineDataTransferShareName property: Offline data transfer share name. + * + * @param offlineDataTransferShareName the offlineDataTransferShareName value to set. + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withOfflineDataTransferShareName(String offlineDataTransferShareName) { + this.offlineDataTransferShareName = offlineDataTransferShareName; + return this; + } + + /** + * Get the cloudTieringStatus property: Cloud tiering status. Only populated if cloud tiering is enabled. + * + * @return the cloudTieringStatus value. + */ + public ServerEndpointCloudTieringStatus cloudTieringStatus() { + return this.cloudTieringStatus; + } + + /** + * Get the recallStatus property: Recall status. Only populated if cloud tiering is enabled. + * + * @return the recallStatus value. + */ + public ServerEndpointRecallStatus recallStatus() { + return this.recallStatus; + } + + /** + * Get the initialDownloadPolicy property: Policy for how namespace and files are recalled during FastDr. + * + * @return the initialDownloadPolicy value. + */ + public InitialDownloadPolicy initialDownloadPolicy() { + return this.initialDownloadPolicy; + } + + /** + * Set the initialDownloadPolicy property: Policy for how namespace and files are recalled during FastDr. + * + * @param initialDownloadPolicy the initialDownloadPolicy value to set. + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withInitialDownloadPolicy(InitialDownloadPolicy initialDownloadPolicy) { + this.initialDownloadPolicy = initialDownloadPolicy; + return this; + } + + /** + * Get the localCacheMode property: Policy for enabling follow-the-sun business models: link local cache to cloud + * behavior to pre-populate before local access. + * + * @return the localCacheMode value. + */ + public LocalCacheMode localCacheMode() { + return this.localCacheMode; + } + + /** + * Set the localCacheMode property: Policy for enabling follow-the-sun business models: link local cache to cloud + * behavior to pre-populate before local access. + * + * @param localCacheMode the localCacheMode value to set. + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withLocalCacheMode(LocalCacheMode localCacheMode) { + this.localCacheMode = localCacheMode; + return this; + } + + /** + * Get the initialUploadPolicy property: Policy for how the initial upload sync session is performed. + * + * @return the initialUploadPolicy value. + */ + public InitialUploadPolicy initialUploadPolicy() { + return this.initialUploadPolicy; + } + + /** + * Set the initialUploadPolicy property: Policy for how the initial upload sync session is performed. + * + * @param initialUploadPolicy the initialUploadPolicy value to set. + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withInitialUploadPolicy(InitialUploadPolicy initialUploadPolicy) { + this.initialUploadPolicy = initialUploadPolicy; + return this; + } + + /** + * Get the serverName property: Server name. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (syncStatus() != null) { + syncStatus().validate(); + } + if (cloudTieringStatus() != null) { + cloudTieringStatus().validate(); + } + if (recallStatus() != null) { + recallStatus().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/StorageSyncServiceInner.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/StorageSyncServiceInner.java new file mode 100644 index 0000000000000..7345bf6f65c4e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/StorageSyncServiceInner.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.models.IncomingTrafficPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Storage Sync Service object. */ +@JsonFlatten +@Fluent +public class StorageSyncServiceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageSyncServiceInner.class); + + /* + * Incoming Traffic Policy + */ + @JsonProperty(value = "properties.incomingTrafficPolicy") + private IncomingTrafficPolicy incomingTrafficPolicy; + + /* + * Storage Sync service status. + */ + @JsonProperty(value = "properties.storageSyncServiceStatus", access = JsonProperty.Access.WRITE_ONLY) + private Integer storageSyncServiceStatus; + + /* + * Storage Sync service Uid + */ + @JsonProperty(value = "properties.storageSyncServiceUid", access = JsonProperty.Access.WRITE_ONLY) + private String storageSyncServiceUid; + + /* + * StorageSyncService Provisioning State + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * StorageSyncService lastWorkflowId + */ + @JsonProperty(value = "properties.lastWorkflowId", access = JsonProperty.Access.WRITE_ONLY) + private String lastWorkflowId; + + /* + * Resource Last Operation Name + */ + @JsonProperty(value = "properties.lastOperationName", access = JsonProperty.Access.WRITE_ONLY) + private String lastOperationName; + + /* + * List of private endpoint connection associated with the specified + * storage sync service + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** + * Get the incomingTrafficPolicy property: Incoming Traffic Policy. + * + * @return the incomingTrafficPolicy value. + */ + public IncomingTrafficPolicy incomingTrafficPolicy() { + return this.incomingTrafficPolicy; + } + + /** + * Set the incomingTrafficPolicy property: Incoming Traffic Policy. + * + * @param incomingTrafficPolicy the incomingTrafficPolicy value to set. + * @return the StorageSyncServiceInner object itself. + */ + public StorageSyncServiceInner withIncomingTrafficPolicy(IncomingTrafficPolicy incomingTrafficPolicy) { + this.incomingTrafficPolicy = incomingTrafficPolicy; + return this; + } + + /** + * Get the storageSyncServiceStatus property: Storage Sync service status. + * + * @return the storageSyncServiceStatus value. + */ + public Integer storageSyncServiceStatus() { + return this.storageSyncServiceStatus; + } + + /** + * Get the storageSyncServiceUid property: Storage Sync service Uid. + * + * @return the storageSyncServiceUid value. + */ + public String storageSyncServiceUid() { + return this.storageSyncServiceUid; + } + + /** + * Get the provisioningState property: StorageSyncService Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the lastWorkflowId property: StorageSyncService lastWorkflowId. + * + * @return the lastWorkflowId value. + */ + public String lastWorkflowId() { + return this.lastWorkflowId; + } + + /** + * Get the lastOperationName property: Resource Last Operation Name. + * + * @return the lastOperationName value. + */ + public String lastOperationName() { + return this.lastOperationName; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connection associated with the specified + * storage sync service. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** {@inheritDoc} */ + @Override + public StorageSyncServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public StorageSyncServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/SyncGroupInner.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/SyncGroupInner.java new file mode 100644 index 0000000000000..a41c5d4fa273f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/SyncGroupInner.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Sync Group object. */ +@JsonFlatten +@Immutable +public class SyncGroupInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SyncGroupInner.class); + + /* + * Unique Id + */ + @JsonProperty(value = "properties.uniqueId", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueId; + + /* + * Sync group status + */ + @JsonProperty(value = "properties.syncGroupStatus", access = JsonProperty.Access.WRITE_ONLY) + private String syncGroupStatus; + + /** + * Get the uniqueId property: Unique Id. + * + * @return the uniqueId value. + */ + public String uniqueId() { + return this.uniqueId; + } + + /** + * Get the syncGroupStatus property: Sync group status. + * + * @return the syncGroupStatus value. + */ + public String syncGroupStatus() { + return this.syncGroupStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/WorkflowInner.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/WorkflowInner.java new file mode 100644 index 0000000000000..eee79eb49757e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/WorkflowInner.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.models.OperationDirection; +import com.azure.resourcemanager.storagesync.models.WorkflowStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Workflow resource. */ +@JsonFlatten +@Fluent +public class WorkflowInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkflowInner.class); + + /* + * last step name + */ + @JsonProperty(value = "properties.lastStepName") + private String lastStepName; + + /* + * workflow status. + */ + @JsonProperty(value = "properties.status") + private WorkflowStatus status; + + /* + * operation direction. + */ + @JsonProperty(value = "properties.operation") + private OperationDirection operation; + + /* + * workflow steps + */ + @JsonProperty(value = "properties.steps") + private String steps; + + /* + * workflow last operation identifier. + */ + @JsonProperty(value = "properties.lastOperationId") + private String lastOperationId; + + /* + * workflow command name. + */ + @JsonProperty(value = "properties.commandName", access = JsonProperty.Access.WRITE_ONLY) + private String commandName; + + /* + * workflow created timestamp. + */ + @JsonProperty(value = "properties.createdTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTimestamp; + + /* + * workflow last status timestamp. + */ + @JsonProperty(value = "properties.lastStatusTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastStatusTimestamp; + + /** + * Get the lastStepName property: last step name. + * + * @return the lastStepName value. + */ + public String lastStepName() { + return this.lastStepName; + } + + /** + * Set the lastStepName property: last step name. + * + * @param lastStepName the lastStepName value to set. + * @return the WorkflowInner object itself. + */ + public WorkflowInner withLastStepName(String lastStepName) { + this.lastStepName = lastStepName; + return this; + } + + /** + * Get the status property: workflow status. + * + * @return the status value. + */ + public WorkflowStatus status() { + return this.status; + } + + /** + * Set the status property: workflow status. + * + * @param status the status value to set. + * @return the WorkflowInner object itself. + */ + public WorkflowInner withStatus(WorkflowStatus status) { + this.status = status; + return this; + } + + /** + * Get the operation property: operation direction. + * + * @return the operation value. + */ + public OperationDirection operation() { + return this.operation; + } + + /** + * Set the operation property: operation direction. + * + * @param operation the operation value to set. + * @return the WorkflowInner object itself. + */ + public WorkflowInner withOperation(OperationDirection operation) { + this.operation = operation; + return this; + } + + /** + * Get the steps property: workflow steps. + * + * @return the steps value. + */ + public String steps() { + return this.steps; + } + + /** + * Set the steps property: workflow steps. + * + * @param steps the steps value to set. + * @return the WorkflowInner object itself. + */ + public WorkflowInner withSteps(String steps) { + this.steps = steps; + return this; + } + + /** + * Get the lastOperationId property: workflow last operation identifier. + * + * @return the lastOperationId value. + */ + public String lastOperationId() { + return this.lastOperationId; + } + + /** + * Set the lastOperationId property: workflow last operation identifier. + * + * @param lastOperationId the lastOperationId value to set. + * @return the WorkflowInner object itself. + */ + public WorkflowInner withLastOperationId(String lastOperationId) { + this.lastOperationId = lastOperationId; + return this; + } + + /** + * Get the commandName property: workflow command name. + * + * @return the commandName value. + */ + public String commandName() { + return this.commandName; + } + + /** + * Get the createdTimestamp property: workflow created timestamp. + * + * @return the createdTimestamp value. + */ + public OffsetDateTime createdTimestamp() { + return this.createdTimestamp; + } + + /** + * Get the lastStatusTimestamp property: workflow last status timestamp. + * + * @return the lastStatusTimestamp value. + */ + public OffsetDateTime lastStatusTimestamp() { + return this.lastStatusTimestamp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/package-info.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/package-info.java new file mode 100644 index 0000000000000..c0867b6b0c364 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for MicrosoftStorageSync. Microsoft Storage Sync Service API. */ +package com.azure.resourcemanager.storagesync.fluent.models; diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/package-info.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/package-info.java new file mode 100644 index 0000000000000..828cc7d4709f2 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for MicrosoftStorageSync. Microsoft Storage Sync Service API. */ +package com.azure.resourcemanager.storagesync.fluent; diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CheckNameAvailabilityResultImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 0000000000000..ebe8cc46bc838 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CheckNameAvailabilityResultImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.resourcemanager.storagesync.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.storagesync.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.storagesync.models.NameAvailabilityReason; + +public final class CheckNameAvailabilityResultImpl implements CheckNameAvailabilityResult { + private CheckNameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + CheckNameAvailabilityResultImpl( + CheckNameAvailabilityResultInner innerObject, + com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public NameAvailabilityReason reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointImpl.java new file mode 100644 index 0000000000000..dabd4f134fd65 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointImpl.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.fluent.models.CloudEndpointInner; +import com.azure.resourcemanager.storagesync.models.BackupRequest; +import com.azure.resourcemanager.storagesync.models.CloudEndpoint; +import com.azure.resourcemanager.storagesync.models.CloudEndpointChangeEnumerationStatus; +import com.azure.resourcemanager.storagesync.models.CloudEndpointCreateParameters; +import com.azure.resourcemanager.storagesync.models.CloudEndpointsRestoreheartbeatResponse; +import com.azure.resourcemanager.storagesync.models.PostBackupResponse; +import com.azure.resourcemanager.storagesync.models.PostRestoreRequest; +import com.azure.resourcemanager.storagesync.models.PreRestoreRequest; +import com.azure.resourcemanager.storagesync.models.TriggerChangeDetectionParameters; + +public final class CloudEndpointImpl implements CloudEndpoint, CloudEndpoint.Definition { + private CloudEndpointInner innerObject; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + CloudEndpointImpl( + CloudEndpointInner innerObject, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String storageAccountResourceId() { + return this.innerModel().storageAccountResourceId(); + } + + public String azureFileShareName() { + return this.innerModel().azureFileShareName(); + } + + public String storageAccountTenantId() { + return this.innerModel().storageAccountTenantId(); + } + + public String partnershipId() { + return this.innerModel().partnershipId(); + } + + public String friendlyName() { + return this.innerModel().friendlyName(); + } + + public String backupEnabled() { + return this.innerModel().backupEnabled(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String lastWorkflowId() { + return this.innerModel().lastWorkflowId(); + } + + public String lastOperationName() { + return this.innerModel().lastOperationName(); + } + + public CloudEndpointChangeEnumerationStatus changeEnumerationStatus() { + return this.innerModel().changeEnumerationStatus(); + } + + public CloudEndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String storageSyncServiceName; + + private String syncGroupName; + + private String cloudEndpointName; + + private CloudEndpointCreateParameters createParameters; + + public CloudEndpointImpl withExistingSyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + this.resourceGroupName = resourceGroupName; + this.storageSyncServiceName = storageSyncServiceName; + this.syncGroupName = syncGroupName; + return this; + } + + public CloudEndpoint create() { + this.innerObject = + serviceManager + .serviceClient() + .getCloudEndpoints() + .create( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + createParameters, + Context.NONE); + return this; + } + + public CloudEndpoint create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCloudEndpoints() + .create( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + createParameters, + context); + return this; + } + + CloudEndpointImpl(String name, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = new CloudEndpointInner(); + this.serviceManager = serviceManager; + this.cloudEndpointName = name; + this.createParameters = new CloudEndpointCreateParameters(); + } + + public CloudEndpoint refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCloudEndpoints() + .getWithResponse( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, Context.NONE) + .getValue(); + return this; + } + + public CloudEndpoint refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCloudEndpoints() + .getWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, context) + .getValue(); + return this; + } + + public void preBackup(BackupRequest parameters) { + serviceManager + .cloudEndpoints() + .preBackup(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + } + + public void preBackup(BackupRequest parameters, Context context) { + serviceManager + .cloudEndpoints() + .preBackup( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + } + + public PostBackupResponse postBackup(BackupRequest parameters) { + return serviceManager + .cloudEndpoints() + .postBackup(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + } + + public PostBackupResponse postBackup(BackupRequest parameters, Context context) { + return serviceManager + .cloudEndpoints() + .postBackup( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + } + + public void preRestore(PreRestoreRequest parameters) { + serviceManager + .cloudEndpoints() + .preRestore(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + } + + public void preRestore(PreRestoreRequest parameters, Context context) { + serviceManager + .cloudEndpoints() + .preRestore( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + } + + public void restoreheartbeat() { + serviceManager + .cloudEndpoints() + .restoreheartbeat(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName); + } + + public CloudEndpointsRestoreheartbeatResponse restoreheartbeatWithResponse(Context context) { + return serviceManager + .cloudEndpoints() + .restoreheartbeatWithResponse( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, context); + } + + public void postRestore(PostRestoreRequest parameters) { + serviceManager + .cloudEndpoints() + .postRestore(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + } + + public void postRestore(PostRestoreRequest parameters, Context context) { + serviceManager + .cloudEndpoints() + .postRestore( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + } + + public void triggerChangeDetection(TriggerChangeDetectionParameters parameters) { + serviceManager + .cloudEndpoints() + .triggerChangeDetection( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + } + + public void triggerChangeDetection(TriggerChangeDetectionParameters parameters, Context context) { + serviceManager + .cloudEndpoints() + .triggerChangeDetection( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + } + + public CloudEndpointImpl withStorageAccountResourceId(String storageAccountResourceId) { + this.createParameters.withStorageAccountResourceId(storageAccountResourceId); + return this; + } + + public CloudEndpointImpl withAzureFileShareName(String azureFileShareName) { + this.createParameters.withAzureFileShareName(azureFileShareName); + return this; + } + + public CloudEndpointImpl withStorageAccountTenantId(String storageAccountTenantId) { + this.createParameters.withStorageAccountTenantId(storageAccountTenantId); + return this; + } + + public CloudEndpointImpl withFriendlyName(String friendlyName) { + this.createParameters.withFriendlyName(friendlyName); + return this; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointsClientImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointsClientImpl.java new file mode 100644 index 0000000000000..5ed60e9e532ff --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointsClientImpl.java @@ -0,0 +1,3308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.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.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storagesync.fluent.CloudEndpointsClient; +import com.azure.resourcemanager.storagesync.fluent.models.CloudEndpointInner; +import com.azure.resourcemanager.storagesync.fluent.models.PostBackupResponseInner; +import com.azure.resourcemanager.storagesync.models.BackupRequest; +import com.azure.resourcemanager.storagesync.models.CloudEndpointCreateParameters; +import com.azure.resourcemanager.storagesync.models.CloudEndpointsGetResponse; +import com.azure.resourcemanager.storagesync.models.CloudEndpointsListBySyncGroupResponse; +import com.azure.resourcemanager.storagesync.models.CloudEndpointsRestoreheartbeatResponse; +import com.azure.resourcemanager.storagesync.models.PostRestoreRequest; +import com.azure.resourcemanager.storagesync.models.PreRestoreRequest; +import com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException; +import com.azure.resourcemanager.storagesync.models.TriggerChangeDetectionParameters; +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 CloudEndpointsClient. */ +public final class CloudEndpointsClientImpl implements CloudEndpointsClient { + private final ClientLogger logger = new ClientLogger(CloudEndpointsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CloudEndpointsService service; + + /** The service client containing this operation class. */ + private final MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of CloudEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudEndpointsClientImpl(MicrosoftStorageSyncImpl client) { + this.service = + RestProxy.create(CloudEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftStorageSyncCloudEndpoints to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftStorageSync") + private interface CloudEndpointsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints" + + "/{cloudEndpointName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @PathParam("cloudEndpointName") String cloudEndpointName, + @BodyParam("application/json") CloudEndpointCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints" + + "/{cloudEndpointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @PathParam("cloudEndpointName") String cloudEndpointName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints" + + "/{cloudEndpointName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @PathParam("cloudEndpointName") String cloudEndpointName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono listBySyncGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints" + + "/{cloudEndpointName}/prebackup") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> preBackup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @PathParam("cloudEndpointName") String cloudEndpointName, + @BodyParam("application/json") BackupRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints" + + "/{cloudEndpointName}/postbackup") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> postBackup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @PathParam("cloudEndpointName") String cloudEndpointName, + @BodyParam("application/json") BackupRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints" + + "/{cloudEndpointName}/prerestore") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> preRestore( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @PathParam("cloudEndpointName") String cloudEndpointName, + @BodyParam("application/json") PreRestoreRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints" + + "/{cloudEndpointName}/restoreheartbeat") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono restoreheartbeat( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @PathParam("cloudEndpointName") String cloudEndpointName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints" + + "/{cloudEndpointName}/postrestore") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> postRestore( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @PathParam("cloudEndpointName") String cloudEndpointName, + @BodyParam("application/json") PostRestoreRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints" + + "/{cloudEndpointName}/triggerChangeDetection") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> triggerChangeDetection( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @PathParam("cloudEndpointName") String cloudEndpointName, + @BodyParam("application/json") TriggerChangeDetectionParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + CloudEndpointCreateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + CloudEndpointCreateParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + accept, + context); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CloudEndpointInner> beginCreateAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + CloudEndpointCreateParameters parameters) { + Mono>> mono = + createWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CloudEndpointInner.class, CloudEndpointInner.class, Context.NONE); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, CloudEndpointInner> beginCreateAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + CloudEndpointCreateParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), CloudEndpointInner.class, CloudEndpointInner.class, context); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CloudEndpointInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + CloudEndpointCreateParameters parameters) { + return beginCreateAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .getSyncPoller(); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, CloudEndpointInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + CloudEndpointCreateParameters parameters, + Context context) { + return beginCreateAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .getSyncPoller(); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + CloudEndpointCreateParameters parameters) { + return beginCreateAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + CloudEndpointCreateParameters parameters, + Context context) { + return beginCreateAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudEndpointInner create( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + CloudEndpointCreateParameters parameters) { + return createAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .block(); + } + + /** + * Create a new CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudEndpointInner create( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + CloudEndpointCreateParameters parameters, + Context context) { + return createAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .block(); + } + + /** + * Get a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given CloudEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given CloudEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + accept, + context); + } + + /** + * Get a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given CloudEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName) + .flatMap( + (CloudEndpointsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given CloudEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudEndpointInner get( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return getAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).block(); + } + + /** + * Get a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given CloudEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudEndpointsGetResponse getWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context) { + return getWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, context) + .block(); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + accept, + context); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName) + .getSyncPoller(); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, context) + .getSyncPoller(); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + deleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).block(); + } + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context) { + deleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, context).block(); + } + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudEndpoint List. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySyncGroupSinglePageAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBySyncGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudEndpoint List. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySyncGroupSinglePageAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySyncGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())); + } + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudEndpoint List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySyncGroupAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return new PagedFlux<>( + () -> listBySyncGroupSinglePageAsync(resourceGroupName, storageSyncServiceName, syncGroupName)); + } + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudEndpoint List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySyncGroupAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context) { + return new PagedFlux<>( + () -> listBySyncGroupSinglePageAsync(resourceGroupName, storageSyncServiceName, syncGroupName, context)); + } + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudEndpoint List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return new PagedIterable<>(listBySyncGroupAsync(resourceGroupName, storageSyncServiceName, syncGroupName)); + } + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudEndpoint List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context) { + return new PagedIterable<>( + listBySyncGroupAsync(resourceGroupName, storageSyncServiceName, syncGroupName, context)); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> preBackupWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .preBackup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> preBackupWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .preBackup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + accept, + context); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPreBackupAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters) { + Mono>> mono = + preBackupWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPreBackupAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + preBackupWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPreBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters) { + return beginPreBackupAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .getSyncPoller(); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPreBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context) { + return beginPreBackupAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .getSyncPoller(); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono preBackupAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters) { + return beginPreBackupAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono preBackupAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context) { + return beginPreBackupAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 preBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters) { + preBackupAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters).block(); + } + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 preBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context) { + preBackupAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .block(); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> postBackupWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .postBackup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> postBackupWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .postBackup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + accept, + context); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PostBackupResponseInner> beginPostBackupAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters) { + Mono>> mono = + postBackupWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PostBackupResponseInner.class, + PostBackupResponseInner.class, + Context.NONE); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PostBackupResponseInner> beginPostBackupAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + postBackupWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PostBackupResponseInner.class, + PostBackupResponseInner.class, + context); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PostBackupResponseInner> beginPostBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters) { + return beginPostBackupAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .getSyncPoller(); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PostBackupResponseInner> beginPostBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context) { + return beginPostBackupAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .getSyncPoller(); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono postBackupAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters) { + return beginPostBackupAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono postBackupAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context) { + return beginPostBackupAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PostBackupResponseInner postBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters) { + return postBackupAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .block(); + } + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PostBackupResponseInner postBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context) { + return postBackupAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .block(); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> preRestoreWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .preRestore( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> preRestoreWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .preRestore( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + accept, + context); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPreRestoreAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters) { + Mono>> mono = + preRestoreWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPreRestoreAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + preRestoreWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPreRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters) { + return beginPreRestoreAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .getSyncPoller(); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPreRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters, + Context context) { + return beginPreRestoreAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .getSyncPoller(); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono preRestoreAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters) { + return beginPreRestoreAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono preRestoreAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters, + Context context) { + return beginPreRestoreAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 preRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters) { + preRestoreAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .block(); + } + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 preRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters, + Context context) { + preRestoreAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .block(); + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreheartbeatWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restoreheartbeat( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreheartbeatWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restoreheartbeat( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + accept, + context); + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreheartbeatAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return restoreheartbeatWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName) + .flatMap((CloudEndpointsRestoreheartbeatResponse res) -> Mono.empty()); + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 restoreheartbeat( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + restoreheartbeatAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName).block(); + } + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 CloudEndpointsRestoreheartbeatResponse restoreheartbeatWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context) { + return restoreheartbeatWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, context) + .block(); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> postRestoreWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .postRestore( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> postRestoreWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .postRestore( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + accept, + context); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPostRestoreAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters) { + Mono>> mono = + postRestoreWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginPostRestoreAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + postRestoreWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPostRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters) { + return beginPostRestoreAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .getSyncPoller(); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginPostRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters, + Context context) { + return beginPostRestoreAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .getSyncPoller(); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono postRestoreAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters) { + return beginPostRestoreAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono postRestoreAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters, + Context context) { + return beginPostRestoreAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 postRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters) { + postRestoreAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .block(); + } + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 postRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters, + Context context) { + postRestoreAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .block(); + } + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> triggerChangeDetectionWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .triggerChangeDetection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> triggerChangeDetectionWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (cloudEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter cloudEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .triggerChangeDetection( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + parameters, + accept, + context); + } + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginTriggerChangeDetectionAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters) { + Mono>> mono = + triggerChangeDetectionWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginTriggerChangeDetectionAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + triggerChangeDetectionWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginTriggerChangeDetection( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters) { + return beginTriggerChangeDetectionAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .getSyncPoller(); + } + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginTriggerChangeDetection( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters, + Context context) { + return beginTriggerChangeDetectionAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .getSyncPoller(); + } + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerChangeDetectionAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters) { + return beginTriggerChangeDetectionAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerChangeDetectionAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters, + Context context) { + return beginTriggerChangeDetectionAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 triggerChangeDetection( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters) { + triggerChangeDetectionAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters) + .block(); + } + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 triggerChangeDetection( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters, + Context context) { + triggerChangeDetectionAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context) + .block(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointsImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointsImpl.java new file mode 100644 index 0000000000000..c80c2b0454833 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointsImpl.java @@ -0,0 +1,411 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.fluent.CloudEndpointsClient; +import com.azure.resourcemanager.storagesync.fluent.models.CloudEndpointInner; +import com.azure.resourcemanager.storagesync.fluent.models.PostBackupResponseInner; +import com.azure.resourcemanager.storagesync.models.BackupRequest; +import com.azure.resourcemanager.storagesync.models.CloudEndpoint; +import com.azure.resourcemanager.storagesync.models.CloudEndpoints; +import com.azure.resourcemanager.storagesync.models.CloudEndpointsGetResponse; +import com.azure.resourcemanager.storagesync.models.CloudEndpointsRestoreheartbeatResponse; +import com.azure.resourcemanager.storagesync.models.PostBackupResponse; +import com.azure.resourcemanager.storagesync.models.PostRestoreRequest; +import com.azure.resourcemanager.storagesync.models.PreRestoreRequest; +import com.azure.resourcemanager.storagesync.models.TriggerChangeDetectionParameters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CloudEndpointsImpl implements CloudEndpoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointsImpl.class); + + private final CloudEndpointsClient innerClient; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + public CloudEndpointsImpl( + CloudEndpointsClient innerClient, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CloudEndpoint get( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + CloudEndpointInner inner = + this.serviceClient().get(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName); + if (inner != null) { + return new CloudEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context) { + CloudEndpointsGetResponse inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CloudEndpointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + this.serviceClient().delete(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName); + } + + public void delete( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context) { + this + .serviceClient() + .delete(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, context); + } + + public PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + PagedIterable inner = + this.serviceClient().listBySyncGroup(resourceGroupName, storageSyncServiceName, syncGroupName); + return Utils.mapPage(inner, inner1 -> new CloudEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listBySyncGroup(resourceGroupName, storageSyncServiceName, syncGroupName, context); + return Utils.mapPage(inner, inner1 -> new CloudEndpointImpl(inner1, this.manager())); + } + + public void preBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters) { + this + .serviceClient() + .preBackup(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + } + + public void preBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context) { + this + .serviceClient() + .preBackup( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + } + + public PostBackupResponse postBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters) { + PostBackupResponseInner inner = + this + .serviceClient() + .postBackup(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + if (inner != null) { + return new PostBackupResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public PostBackupResponse postBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context) { + PostBackupResponseInner inner = + this + .serviceClient() + .postBackup( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + if (inner != null) { + return new PostBackupResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public void preRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters) { + this + .serviceClient() + .preRestore(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + } + + public void preRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters, + Context context) { + this + .serviceClient() + .preRestore( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + } + + public void restoreheartbeat( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + this + .serviceClient() + .restoreheartbeat(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName); + } + + public CloudEndpointsRestoreheartbeatResponse restoreheartbeatWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context) { + return this + .serviceClient() + .restoreheartbeatWithResponse( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, context); + } + + public void postRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters) { + this + .serviceClient() + .postRestore(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + } + + public void postRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters, + Context context) { + this + .serviceClient() + .postRestore( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + } + + public void triggerChangeDetection( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters) { + this + .serviceClient() + .triggerChangeDetection( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters); + } + + public void triggerChangeDetection( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters, + Context context) { + this + .serviceClient() + .triggerChangeDetection( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, parameters, context); + } + + public CloudEndpoint getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String syncGroupName = Utils.getValueFromIdByName(id, "syncGroups"); + if (syncGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'syncGroups'.", id))); + } + String cloudEndpointName = Utils.getValueFromIdByName(id, "cloudEndpoints"); + if (cloudEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'cloudEndpoints'.", id))); + } + return this + .getWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String syncGroupName = Utils.getValueFromIdByName(id, "syncGroups"); + if (syncGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'syncGroups'.", id))); + } + String cloudEndpointName = Utils.getValueFromIdByName(id, "cloudEndpoints"); + if (cloudEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'cloudEndpoints'.", id))); + } + return this + .getWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String syncGroupName = Utils.getValueFromIdByName(id, "syncGroups"); + if (syncGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'syncGroups'.", id))); + } + String cloudEndpointName = Utils.getValueFromIdByName(id, "cloudEndpoints"); + if (cloudEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'cloudEndpoints'.", id))); + } + this.delete(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String syncGroupName = Utils.getValueFromIdByName(id, "syncGroups"); + if (syncGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'syncGroups'.", id))); + } + String cloudEndpointName = Utils.getValueFromIdByName(id, "cloudEndpoints"); + if (cloudEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'cloudEndpoints'.", id))); + } + this.delete(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, context); + } + + private CloudEndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } + + public CloudEndpointImpl define(String name) { + return new CloudEndpointImpl(name, this.manager()); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/MicrosoftStorageSyncBuilder.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/MicrosoftStorageSyncBuilder.java new file mode 100644 index 0000000000000..dd9454b8274c4 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/MicrosoftStorageSyncBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the MicrosoftStorageSyncImpl type. */ +@ServiceClientBuilder(serviceClients = {MicrosoftStorageSyncImpl.class}) +public final class MicrosoftStorageSyncBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the MicrosoftStorageSyncBuilder. + */ + public MicrosoftStorageSyncBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the MicrosoftStorageSyncBuilder. + */ + public MicrosoftStorageSyncBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the MicrosoftStorageSyncBuilder. + */ + public MicrosoftStorageSyncBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the MicrosoftStorageSyncBuilder. + */ + public MicrosoftStorageSyncBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the MicrosoftStorageSyncBuilder. + */ + public MicrosoftStorageSyncBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the MicrosoftStorageSyncBuilder. + */ + public MicrosoftStorageSyncBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of MicrosoftStorageSyncImpl with the provided parameters. + * + * @return an instance of MicrosoftStorageSyncImpl. + */ + public MicrosoftStorageSyncImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + MicrosoftStorageSyncImpl client = + new MicrosoftStorageSyncImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/MicrosoftStorageSyncImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/MicrosoftStorageSyncImpl.java new file mode 100644 index 0000000000000..87d8d3769937e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/MicrosoftStorageSyncImpl.java @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.storagesync.fluent.CloudEndpointsClient; +import com.azure.resourcemanager.storagesync.fluent.MicrosoftStorageSync; +import com.azure.resourcemanager.storagesync.fluent.OperationStatusOperationsClient; +import com.azure.resourcemanager.storagesync.fluent.OperationsClient; +import com.azure.resourcemanager.storagesync.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.storagesync.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.storagesync.fluent.RegisteredServersClient; +import com.azure.resourcemanager.storagesync.fluent.ServerEndpointsClient; +import com.azure.resourcemanager.storagesync.fluent.StorageSyncServicesClient; +import com.azure.resourcemanager.storagesync.fluent.SyncGroupsClient; +import com.azure.resourcemanager.storagesync.fluent.WorkflowsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the MicrosoftStorageSyncImpl type. */ +@ServiceClient(builder = MicrosoftStorageSyncBuilder.class) +public final class MicrosoftStorageSyncImpl implements MicrosoftStorageSync { + private final ClientLogger logger = new ClientLogger(MicrosoftStorageSyncImpl.class); + + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The StorageSyncServicesClient object to access its operations. */ + private final StorageSyncServicesClient storageSyncServices; + + /** + * Gets the StorageSyncServicesClient object to access its operations. + * + * @return the StorageSyncServicesClient object. + */ + public StorageSyncServicesClient getStorageSyncServices() { + return this.storageSyncServices; + } + + /** 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; + } + + /** 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 SyncGroupsClient object to access its operations. */ + private final SyncGroupsClient syncGroups; + + /** + * Gets the SyncGroupsClient object to access its operations. + * + * @return the SyncGroupsClient object. + */ + public SyncGroupsClient getSyncGroups() { + return this.syncGroups; + } + + /** The CloudEndpointsClient object to access its operations. */ + private final CloudEndpointsClient cloudEndpoints; + + /** + * Gets the CloudEndpointsClient object to access its operations. + * + * @return the CloudEndpointsClient object. + */ + public CloudEndpointsClient getCloudEndpoints() { + return this.cloudEndpoints; + } + + /** The ServerEndpointsClient object to access its operations. */ + private final ServerEndpointsClient serverEndpoints; + + /** + * Gets the ServerEndpointsClient object to access its operations. + * + * @return the ServerEndpointsClient object. + */ + public ServerEndpointsClient getServerEndpoints() { + return this.serverEndpoints; + } + + /** The RegisteredServersClient object to access its operations. */ + private final RegisteredServersClient registeredServers; + + /** + * Gets the RegisteredServersClient object to access its operations. + * + * @return the RegisteredServersClient object. + */ + public RegisteredServersClient getRegisteredServers() { + return this.registeredServers; + } + + /** The WorkflowsClient object to access its operations. */ + private final WorkflowsClient workflows; + + /** + * Gets the WorkflowsClient object to access its operations. + * + * @return the WorkflowsClient object. + */ + public WorkflowsClient getWorkflows() { + return this.workflows; + } + + /** The OperationStatusOperationsClient object to access its operations. */ + private final OperationStatusOperationsClient operationStatusOperations; + + /** + * Gets the OperationStatusOperationsClient object to access its operations. + * + * @return the OperationStatusOperationsClient object. + */ + public OperationStatusOperationsClient getOperationStatusOperations() { + return this.operationStatusOperations; + } + + /** + * Initializes an instance of MicrosoftStorageSync client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + MicrosoftStorageSyncImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2020-09-01"; + this.operations = new OperationsClientImpl(this); + this.storageSyncServices = new StorageSyncServicesClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.syncGroups = new SyncGroupsClientImpl(this); + this.cloudEndpoints = new CloudEndpointsClientImpl(this); + this.serverEndpoints = new ServerEndpointsClientImpl(this); + this.registeredServers = new RegisteredServersClientImpl(this); + this.workflows = new WorkflowsClientImpl(this); + this.operationStatusOperations = new OperationStatusOperationsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationEntityImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationEntityImpl.java new file mode 100644 index 0000000000000..9135bbde4045f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationEntityImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.resourcemanager.storagesync.fluent.models.OperationEntityInner; +import com.azure.resourcemanager.storagesync.models.OperationDisplayInfo; +import com.azure.resourcemanager.storagesync.models.OperationEntity; +import com.azure.resourcemanager.storagesync.models.OperationProperties; + +public final class OperationEntityImpl implements OperationEntity { + private OperationEntityInner innerObject; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + OperationEntityImpl( + OperationEntityInner innerObject, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplayInfo display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public OperationProperties properties() { + return this.innerModel().properties(); + } + + public OperationEntityInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationStatusImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationStatusImpl.java new file mode 100644 index 0000000000000..489a0631c6e56 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationStatusImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.resourcemanager.storagesync.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.storagesync.models.OperationStatus; +import com.azure.resourcemanager.storagesync.models.StorageSyncApiError; +import java.time.OffsetDateTime; + +public final class OperationStatusImpl implements OperationStatus { + private OperationStatusInner innerObject; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + OperationStatusImpl( + OperationStatusInner innerObject, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public StorageSyncApiError error() { + return this.innerModel().error(); + } + + public OperationStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationStatusOperationsClientImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationStatusOperationsClientImpl.java new file mode 100644 index 0000000000000..05d91519be670 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationStatusOperationsClientImpl.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.fluent.OperationStatusOperationsClient; +import com.azure.resourcemanager.storagesync.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.storagesync.models.OperationStatusOperationsGetResponse; +import com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationStatusOperationsClient. */ +public final class OperationStatusOperationsClientImpl implements OperationStatusOperationsClient { + private final ClientLogger logger = new ClientLogger(OperationStatusOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationStatusOperationsService service; + + /** The service client containing this operation class. */ + private final MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of OperationStatusOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationStatusOperationsClientImpl(MicrosoftStorageSyncImpl client) { + this.service = + RestProxy + .create( + OperationStatusOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftStorageSyncOperationStatusOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftStorageSync") + private interface OperationStatusOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/locations/{locationName}/workflows/{workflowId}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("locationName") String locationName, + @PathParam("workflowId") String workflowId, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param locationName The desired region to obtain information from. + * @param workflowId workflow Id. + * @param operationId operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String locationName, String workflowId, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (workflowId == null) { + return Mono.error(new IllegalArgumentException("Parameter workflowId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + locationName, + workflowId, + operationId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param locationName The desired region to obtain information from. + * @param workflowId workflow Id. + * @param operationId operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String locationName, String workflowId, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (workflowId == null) { + return Mono.error(new IllegalArgumentException("Parameter workflowId is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + locationName, + workflowId, + operationId, + accept, + context); + } + + /** + * Get Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param locationName The desired region to obtain information from. + * @param workflowId workflow Id. + * @param operationId operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String locationName, String workflowId, String operationId) { + return getWithResponseAsync(resourceGroupName, locationName, workflowId, operationId) + .flatMap( + (OperationStatusOperationsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param locationName The desired region to obtain information from. + * @param workflowId workflow Id. + * @param operationId operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get( + String resourceGroupName, String locationName, String workflowId, String operationId) { + return getAsync(resourceGroupName, locationName, workflowId, operationId).block(); + } + + /** + * Get Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param locationName The desired region to obtain information from. + * @param workflowId workflow Id. + * @param operationId operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusOperationsGetResponse getWithResponse( + String resourceGroupName, String locationName, String workflowId, String operationId, Context context) { + return getWithResponseAsync(resourceGroupName, locationName, workflowId, operationId, context).block(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationStatusOperationsImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationStatusOperationsImpl.java new file mode 100644 index 0000000000000..18d037c6c7b2f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationStatusOperationsImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.fluent.OperationStatusOperationsClient; +import com.azure.resourcemanager.storagesync.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.storagesync.models.OperationStatus; +import com.azure.resourcemanager.storagesync.models.OperationStatusOperations; +import com.azure.resourcemanager.storagesync.models.OperationStatusOperationsGetResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationStatusOperationsImpl implements OperationStatusOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusOperationsImpl.class); + + private final OperationStatusOperationsClient innerClient; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + public OperationStatusOperationsImpl( + OperationStatusOperationsClient innerClient, + com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OperationStatus get(String resourceGroupName, String locationName, String workflowId, String operationId) { + OperationStatusInner inner = this.serviceClient().get(resourceGroupName, locationName, workflowId, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String locationName, String workflowId, String operationId, Context context) { + OperationStatusOperationsGetResponse inner = + this.serviceClient().getWithResponse(resourceGroupName, locationName, workflowId, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private OperationStatusOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationsClientImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..dd856333a07a6 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationsClientImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.fluent.OperationsClient; +import com.azure.resourcemanager.storagesync.fluent.models.OperationEntityInner; +import com.azure.resourcemanager.storagesync.models.OperationsListNextResponse; +import com.azure.resourcemanager.storagesync.models.OperationsListResponse; +import com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException; +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 { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(MicrosoftStorageSyncImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftStorageSyncOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftStorageSync") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.StorageSync/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of storage sync operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + res.getDeserializedHeaders())) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of storage sync operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + res.getDeserializedHeaders())); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of storage sync operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of storage sync operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of storage sync operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of storage sync operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of storage sync operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + res.getDeserializedHeaders())) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of storage sync operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + res.getDeserializedHeaders())); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationsImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..70a6d0b5a53f8 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.fluent.OperationsClient; +import com.azure.resourcemanager.storagesync.fluent.models.OperationEntityInner; +import com.azure.resourcemanager.storagesync.models.OperationEntity; +import com.azure.resourcemanager.storagesync.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationEntityImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationEntityImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PostBackupResponseImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PostBackupResponseImpl.java new file mode 100644 index 0000000000000..9c7c73340d71a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PostBackupResponseImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.resourcemanager.storagesync.fluent.models.PostBackupResponseInner; +import com.azure.resourcemanager.storagesync.models.PostBackupResponse; + +public final class PostBackupResponseImpl implements PostBackupResponse { + private PostBackupResponseInner innerObject; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + PostBackupResponseImpl( + PostBackupResponseInner innerObject, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String cloudEndpointName() { + return this.innerModel().cloudEndpointName(); + } + + public PostBackupResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateEndpointConnectionImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..65876d5d42415 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.storagesync.models.PrivateEndpoint; +import com.azure.resourcemanager.storagesync.models.PrivateEndpointConnection; +import com.azure.resourcemanager.storagesync.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.storagesync.models.PrivateLinkServiceConnectionState; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.storagesync.StoragesyncManager 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 PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String storageSyncServiceName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingStorageSyncService( + String resourceGroupName, String storageSyncServiceName) { + this.resourceGroupName = resourceGroupName; + this.storageSyncServiceName = storageSyncServiceName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .create( + resourceGroupName, + storageSyncServiceName, + privateEndpointConnectionName, + this.innerModel(), + Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .create( + resourceGroupName, + storageSyncServiceName, + privateEndpointConnectionName, + this.innerModel(), + context); + return this; + } + + PrivateEndpointConnectionImpl( + String name, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..2a25e0724d434 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storagesync.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.storagesync.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.storagesync.models.PrivateEndpointConnectionsListByStorageSyncServiceResponse; +import com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException; +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 { + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(MicrosoftStorageSyncImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftStorageSyncPrivateEndpointConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftStorageSync") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections" + + "/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections" + + "/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections" + + "/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono listByStorageSyncService( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 storage sync service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + storageSyncServiceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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 StorageSyncApiErrorException 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 storage sync service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + storageSyncServiceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context); + } + + /** + * Gets the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 storage sync service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 storage sync service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName).block(); + } + + /** + * Gets the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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 StorageSyncApiErrorException 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 storage sync service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + Context context) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, context) + .block(); + } + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + resourceGroupName, + storageSyncServiceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + resourceGroupName, + storageSyncServiceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + properties, + accept, + context); + } + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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) + private PollerFlux, PrivateEndpointConnectionInner> beginCreateAsync( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + Mono>> mono = + createWithResponseAsync( + resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, properties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + Context.NONE); + } + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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) + private PollerFlux, PrivateEndpointConnectionInner> beginCreateAsync( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, properties, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + context); + } + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + return beginCreateAsync(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, properties) + .getSyncPoller(); + } + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context) { + return beginCreateAsync( + resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, properties, context) + .getSyncPoller(); + } + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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) + private Mono createAsync( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + return beginCreateAsync(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, properties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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) + private Mono createAsync( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context) { + return beginCreateAsync( + resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, properties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 storageSyncServiceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties) { + return createAsync(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, properties) + .block(); + } + + /** + * Update the state of specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @param properties The private endpoint connection properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 storageSyncServiceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner properties, + Context context) { + return createAsync( + resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, properties, context) + .block(); + } + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + storageSyncServiceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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 StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + storageSyncServiceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + privateEndpointConnectionName, + accept, + context); + } + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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 StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName) + .getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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 StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + Context context) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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 StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + Context context) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure + * resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 storageSyncServiceName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName).block(); + } + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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 StorageSyncApiErrorException 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 storageSyncServiceName, + String privateEndpointConnectionName, + Context context) { + deleteAsync(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, context).block(); + } + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageSyncServiceSinglePageAsync( + String resourceGroupName, String storageSyncServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByStorageSyncService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())) + .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 storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageSyncServiceSinglePageAsync( + String resourceGroupName, String storageSyncServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByStorageSyncService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())); + } + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByStorageSyncServiceAsync( + String resourceGroupName, String storageSyncServiceName) { + return new PagedFlux<>( + () -> listByStorageSyncServiceSinglePageAsync(resourceGroupName, storageSyncServiceName)); + } + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByStorageSyncServiceAsync( + String resourceGroupName, String storageSyncServiceName, Context context) { + return new PagedFlux<>( + () -> listByStorageSyncServiceSinglePageAsync(resourceGroupName, storageSyncServiceName, context)); + } + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName) { + return new PagedIterable<>(listByStorageSyncServiceAsync(resourceGroupName, storageSyncServiceName)); + } + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context) { + return new PagedIterable<>(listByStorageSyncServiceAsync(resourceGroupName, storageSyncServiceName, context)); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateEndpointConnectionsImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..19d4db18cd779 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.storagesync.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.storagesync.models.PrivateEndpointConnection; +import com.azure.resourcemanager.storagesync.models.PrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateEndpointConnection get( + String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName); + } + + public void delete( + String resourceGroupName, + String storageSyncServiceName, + String privateEndpointConnectionName, + Context context) { + this.serviceClient().delete(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, context); + } + + public PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName) { + PagedIterable inner = + this.serviceClient().listByStorageSyncService(resourceGroupName, storageSyncServiceName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context) { + PagedIterable inner = + this.serviceClient().listByStorageSyncService(resourceGroupName, storageSyncServiceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateLinkResourceListResultImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateLinkResourceListResultImpl.java new file mode 100644 index 0000000000000..7b59753a88eb2 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateLinkResourceListResultImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.resourcemanager.storagesync.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.storagesync.models.PrivateLinkResource; +import com.azure.resourcemanager.storagesync.models.PrivateLinkResourceListResult; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceListResultImpl implements PrivateLinkResourceListResult { + private PrivateLinkResourceListResultInner innerObject; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + PrivateLinkResourceListResultImpl( + PrivateLinkResourceListResultInner innerObject, + com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateLinkResourcesClientImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..6ce5c02e4d58d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.storagesync.fluent.models.PrivateLinkResourceListResultInner; +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 { + private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(MicrosoftStorageSyncImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftStorageSyncPrivateLinkResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftStorageSync") + private interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByStorageSyncService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the private link resources that need to be created for a storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 storage sync service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageSyncServiceWithResponseAsync( + String resourceGroupName, String storageSyncServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByStorageSyncService( + this.client.getEndpoint(), + resourceGroupName, + storageSyncServiceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources that need to be created for a storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 storage sync service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageSyncServiceWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByStorageSyncService( + this.client.getEndpoint(), + resourceGroupName, + storageSyncServiceName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the private link resources that need to be created for a storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 storage sync service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByStorageSyncServiceAsync( + String resourceGroupName, String storageSyncServiceName) { + return listByStorageSyncServiceWithResponseAsync(resourceGroupName, storageSyncServiceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the private link resources that need to be created for a storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 storage sync service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceListResultInner listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName) { + return listByStorageSyncServiceAsync(resourceGroupName, storageSyncServiceName).block(); + } + + /** + * Gets the private link resources that need to be created for a storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 storage sync service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByStorageSyncServiceWithResponse( + String resourceGroupName, String storageSyncServiceName, Context context) { + return listByStorageSyncServiceWithResponseAsync(resourceGroupName, storageSyncServiceName, context).block(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateLinkResourcesImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..817d09aa92bab --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.storagesync.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.storagesync.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.storagesync.models.PrivateLinkResources; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateLinkResourceListResult listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName) { + PrivateLinkResourceListResultInner inner = + this.serviceClient().listByStorageSyncService(resourceGroupName, storageSyncServiceName); + if (inner != null) { + return new PrivateLinkResourceListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listByStorageSyncServiceWithResponse( + String resourceGroupName, String storageSyncServiceName, Context context) { + Response inner = + this + .serviceClient() + .listByStorageSyncServiceWithResponse(resourceGroupName, storageSyncServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/RegisteredServerImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/RegisteredServerImpl.java new file mode 100644 index 0000000000000..7104dcd9071f7 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/RegisteredServerImpl.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.fluent.models.RegisteredServerInner; +import com.azure.resourcemanager.storagesync.models.RegisteredServer; +import com.azure.resourcemanager.storagesync.models.RegisteredServerAgentVersionStatus; +import com.azure.resourcemanager.storagesync.models.RegisteredServerCreateParameters; +import com.azure.resourcemanager.storagesync.models.TriggerRolloverRequest; +import java.time.OffsetDateTime; + +public final class RegisteredServerImpl implements RegisteredServer, RegisteredServer.Definition { + private RegisteredServerInner innerObject; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + RegisteredServerImpl( + RegisteredServerInner innerObject, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String serverCertificate() { + return this.innerModel().serverCertificate(); + } + + public String agentVersion() { + return this.innerModel().agentVersion(); + } + + public RegisteredServerAgentVersionStatus agentVersionStatus() { + return this.innerModel().agentVersionStatus(); + } + + public OffsetDateTime agentVersionExpirationDate() { + return this.innerModel().agentVersionExpirationDate(); + } + + public String serverOSVersion() { + return this.innerModel().serverOSVersion(); + } + + public Integer serverManagementErrorCode() { + return this.innerModel().serverManagementErrorCode(); + } + + public String lastHeartBeat() { + return this.innerModel().lastHeartBeat(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String serverRole() { + return this.innerModel().serverRole(); + } + + public String clusterId() { + return this.innerModel().clusterId(); + } + + public String clusterName() { + return this.innerModel().clusterName(); + } + + public String serverId() { + return this.innerModel().serverId(); + } + + public String storageSyncServiceUid() { + return this.innerModel().storageSyncServiceUid(); + } + + public String lastWorkflowId() { + return this.innerModel().lastWorkflowId(); + } + + public String lastOperationName() { + return this.innerModel().lastOperationName(); + } + + public String discoveryEndpointUri() { + return this.innerModel().discoveryEndpointUri(); + } + + public String resourceLocation() { + return this.innerModel().resourceLocation(); + } + + public String serviceLocation() { + return this.innerModel().serviceLocation(); + } + + public String friendlyName() { + return this.innerModel().friendlyName(); + } + + public String managementEndpointUri() { + return this.innerModel().managementEndpointUri(); + } + + public String monitoringEndpointUri() { + return this.innerModel().monitoringEndpointUri(); + } + + public String monitoringConfiguration() { + return this.innerModel().monitoringConfiguration(); + } + + public String serverName() { + return this.innerModel().serverName(); + } + + public RegisteredServerInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String storageSyncServiceName; + + private String serverId; + + private RegisteredServerCreateParameters createParameters; + + public RegisteredServerImpl withExistingStorageSyncService( + String resourceGroupName, String storageSyncServiceName) { + this.resourceGroupName = resourceGroupName; + this.storageSyncServiceName = storageSyncServiceName; + return this; + } + + public RegisteredServer create() { + this.innerObject = + serviceManager + .serviceClient() + .getRegisteredServers() + .create(resourceGroupName, storageSyncServiceName, serverId, createParameters, Context.NONE); + return this; + } + + public RegisteredServer create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRegisteredServers() + .create(resourceGroupName, storageSyncServiceName, serverId, createParameters, context); + return this; + } + + RegisteredServerImpl(String name, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = new RegisteredServerInner(); + this.serviceManager = serviceManager; + this.serverId = name; + this.createParameters = new RegisteredServerCreateParameters(); + } + + public RegisteredServer refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getRegisteredServers() + .getWithResponse(resourceGroupName, storageSyncServiceName, serverId, Context.NONE) + .getValue(); + return this; + } + + public RegisteredServer refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getRegisteredServers() + .getWithResponse(resourceGroupName, storageSyncServiceName, serverId, context) + .getValue(); + return this; + } + + public void triggerRollover(TriggerRolloverRequest parameters) { + serviceManager + .registeredServers() + .triggerRollover(resourceGroupName, storageSyncServiceName, serverId, parameters); + } + + public void triggerRollover(TriggerRolloverRequest parameters, Context context) { + serviceManager + .registeredServers() + .triggerRollover(resourceGroupName, storageSyncServiceName, serverId, parameters, context); + } + + public RegisteredServerImpl withServerCertificate(String serverCertificate) { + this.createParameters.withServerCertificate(serverCertificate); + return this; + } + + public RegisteredServerImpl withAgentVersion(String agentVersion) { + this.createParameters.withAgentVersion(agentVersion); + return this; + } + + public RegisteredServerImpl withServerOSVersion(String serverOSVersion) { + this.createParameters.withServerOSVersion(serverOSVersion); + return this; + } + + public RegisteredServerImpl withLastHeartBeat(String lastHeartBeat) { + this.createParameters.withLastHeartBeat(lastHeartBeat); + return this; + } + + public RegisteredServerImpl withServerRole(String serverRole) { + this.createParameters.withServerRole(serverRole); + return this; + } + + public RegisteredServerImpl withClusterId(String clusterId) { + this.createParameters.withClusterId(clusterId); + return this; + } + + public RegisteredServerImpl withClusterName(String clusterName) { + this.createParameters.withClusterName(clusterName); + return this; + } + + public RegisteredServerImpl withServerId(String serverId) { + this.createParameters.withServerId(serverId); + return this; + } + + public RegisteredServerImpl withFriendlyName(String friendlyName) { + this.createParameters.withFriendlyName(friendlyName); + return this; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/RegisteredServersClientImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/RegisteredServersClientImpl.java new file mode 100644 index 0000000000000..bb5246626bc12 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/RegisteredServersClientImpl.java @@ -0,0 +1,1390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.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.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storagesync.fluent.RegisteredServersClient; +import com.azure.resourcemanager.storagesync.fluent.models.RegisteredServerInner; +import com.azure.resourcemanager.storagesync.models.RegisteredServerCreateParameters; +import com.azure.resourcemanager.storagesync.models.RegisteredServersGetResponse; +import com.azure.resourcemanager.storagesync.models.RegisteredServersListByStorageSyncServiceResponse; +import com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException; +import com.azure.resourcemanager.storagesync.models.TriggerRolloverRequest; +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 RegisteredServersClient. */ +public final class RegisteredServersClientImpl implements RegisteredServersClient { + private final ClientLogger logger = new ClientLogger(RegisteredServersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RegisteredServersService service; + + /** The service client containing this operation class. */ + private final MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of RegisteredServersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegisteredServersClientImpl(MicrosoftStorageSyncImpl client) { + this.service = + RestProxy.create(RegisteredServersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftStorageSyncRegisteredServers to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftStorageSync") + private interface RegisteredServersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/registeredServers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono listByStorageSyncService( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("serverId") String serverId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("serverId") String serverId, + @BodyParam("application/json") RegisteredServerCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("serverId") String serverId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/registeredServers/{serverId}/triggerRollover") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> triggerRollover( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("serverId") String serverId, + @BodyParam("application/json") TriggerRolloverRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageSyncServiceSinglePageAsync( + String resourceGroupName, String storageSyncServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByStorageSyncService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageSyncServiceSinglePageAsync( + String resourceGroupName, String storageSyncServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByStorageSyncService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())); + } + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByStorageSyncServiceAsync( + String resourceGroupName, String storageSyncServiceName) { + return new PagedFlux<>( + () -> listByStorageSyncServiceSinglePageAsync(resourceGroupName, storageSyncServiceName)); + } + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByStorageSyncServiceAsync( + String resourceGroupName, String storageSyncServiceName, Context context) { + return new PagedFlux<>( + () -> listByStorageSyncServiceSinglePageAsync(resourceGroupName, storageSyncServiceName, context)); + } + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName) { + return new PagedIterable<>(listByStorageSyncServiceAsync(resourceGroupName, storageSyncServiceName)); + } + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context) { + return new PagedIterable<>(listByStorageSyncServiceAsync(resourceGroupName, storageSyncServiceName, context)); + } + + /** + * Get a given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String serverId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (serverId == null) { + return Mono.error(new IllegalArgumentException("Parameter serverId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + serverId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String serverId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (serverId == null) { + return Mono.error(new IllegalArgumentException("Parameter serverId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + serverId, + accept, + context); + } + + /** + * Get a given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String storageSyncServiceName, String serverId) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, serverId) + .flatMap( + (RegisteredServersGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegisteredServerInner get(String resourceGroupName, String storageSyncServiceName, String serverId) { + return getAsync(resourceGroupName, storageSyncServiceName, serverId).block(); + } + + /** + * Get a given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegisteredServersGetResponse getWithResponse( + String resourceGroupName, String storageSyncServiceName, String serverId, Context context) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, serverId, context).block(); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registered Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + RegisteredServerCreateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (serverId == null) { + return Mono.error(new IllegalArgumentException("Parameter serverId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + serverId, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registered Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + RegisteredServerCreateParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (serverId == null) { + return Mono.error(new IllegalArgumentException("Parameter serverId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + serverId, + parameters, + accept, + context); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registered Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RegisteredServerInner> beginCreateAsync( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + RegisteredServerCreateParameters parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, storageSyncServiceName, serverId, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RegisteredServerInner.class, + RegisteredServerInner.class, + Context.NONE); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registered Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RegisteredServerInner> beginCreateAsync( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + RegisteredServerCreateParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, storageSyncServiceName, serverId, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RegisteredServerInner.class, RegisteredServerInner.class, context); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registered Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RegisteredServerInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + RegisteredServerCreateParameters parameters) { + return beginCreateAsync(resourceGroupName, storageSyncServiceName, serverId, parameters).getSyncPoller(); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registered Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RegisteredServerInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + RegisteredServerCreateParameters parameters, + Context context) { + return beginCreateAsync(resourceGroupName, storageSyncServiceName, serverId, parameters, context) + .getSyncPoller(); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registered Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + RegisteredServerCreateParameters parameters) { + return beginCreateAsync(resourceGroupName, storageSyncServiceName, serverId, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registered Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + RegisteredServerCreateParameters parameters, + Context context) { + return beginCreateAsync(resourceGroupName, storageSyncServiceName, serverId, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registered Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegisteredServerInner create( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + RegisteredServerCreateParameters parameters) { + return createAsync(resourceGroupName, storageSyncServiceName, serverId, parameters).block(); + } + + /** + * Add a new registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param parameters Body of Registered Server object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return registered Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RegisteredServerInner create( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + RegisteredServerCreateParameters parameters, + Context context) { + return createAsync(resourceGroupName, storageSyncServiceName, serverId, parameters, context).block(); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String serverId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (serverId == null) { + return Mono.error(new IllegalArgumentException("Parameter serverId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + serverId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String serverId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (serverId == null) { + return Mono.error(new IllegalArgumentException("Parameter serverId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + serverId, + accept, + context); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String storageSyncServiceName, String serverId) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, storageSyncServiceName, serverId); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String storageSyncServiceName, String serverId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, storageSyncServiceName, serverId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String storageSyncServiceName, String serverId) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, serverId).getSyncPoller(); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String storageSyncServiceName, String serverId, Context context) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, serverId, context).getSyncPoller(); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String storageSyncServiceName, String serverId) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, serverId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String storageSyncServiceName, String serverId, Context context) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, serverId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 storageSyncServiceName, String serverId) { + deleteAsync(resourceGroupName, storageSyncServiceName, serverId).block(); + } + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 storageSyncServiceName, String serverId, Context context) { + deleteAsync(resourceGroupName, storageSyncServiceName, serverId, context).block(); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> triggerRolloverWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String serverId, TriggerRolloverRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (serverId == null) { + return Mono.error(new IllegalArgumentException("Parameter serverId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .triggerRollover( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + serverId, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> triggerRolloverWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + TriggerRolloverRequest parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (serverId == null) { + return Mono.error(new IllegalArgumentException("Parameter serverId is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .triggerRollover( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + serverId, + parameters, + accept, + context); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginTriggerRolloverAsync( + String resourceGroupName, String storageSyncServiceName, String serverId, TriggerRolloverRequest parameters) { + Mono>> mono = + triggerRolloverWithResponseAsync(resourceGroupName, storageSyncServiceName, serverId, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginTriggerRolloverAsync( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + TriggerRolloverRequest parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + triggerRolloverWithResponseAsync(resourceGroupName, storageSyncServiceName, serverId, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginTriggerRollover( + String resourceGroupName, String storageSyncServiceName, String serverId, TriggerRolloverRequest parameters) { + return beginTriggerRolloverAsync(resourceGroupName, storageSyncServiceName, serverId, parameters) + .getSyncPoller(); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginTriggerRollover( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + TriggerRolloverRequest parameters, + Context context) { + return beginTriggerRolloverAsync(resourceGroupName, storageSyncServiceName, serverId, parameters, context) + .getSyncPoller(); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerRolloverAsync( + String resourceGroupName, String storageSyncServiceName, String serverId, TriggerRolloverRequest parameters) { + return beginTriggerRolloverAsync(resourceGroupName, storageSyncServiceName, serverId, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerRolloverAsync( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + TriggerRolloverRequest parameters, + Context context) { + return beginTriggerRolloverAsync(resourceGroupName, storageSyncServiceName, serverId, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 triggerRollover( + String resourceGroupName, String storageSyncServiceName, String serverId, TriggerRolloverRequest parameters) { + triggerRolloverAsync(resourceGroupName, storageSyncServiceName, serverId, parameters).block(); + } + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 triggerRollover( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + TriggerRolloverRequest parameters, + Context context) { + triggerRolloverAsync(resourceGroupName, storageSyncServiceName, serverId, parameters, context).block(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/RegisteredServersImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/RegisteredServersImpl.java new file mode 100644 index 0000000000000..2c6ac411fabf9 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/RegisteredServersImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.fluent.RegisteredServersClient; +import com.azure.resourcemanager.storagesync.fluent.models.RegisteredServerInner; +import com.azure.resourcemanager.storagesync.models.RegisteredServer; +import com.azure.resourcemanager.storagesync.models.RegisteredServers; +import com.azure.resourcemanager.storagesync.models.RegisteredServersGetResponse; +import com.azure.resourcemanager.storagesync.models.TriggerRolloverRequest; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RegisteredServersImpl implements RegisteredServers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegisteredServersImpl.class); + + private final RegisteredServersClient innerClient; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + public RegisteredServersImpl( + RegisteredServersClient innerClient, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName) { + PagedIterable inner = + this.serviceClient().listByStorageSyncService(resourceGroupName, storageSyncServiceName); + return Utils.mapPage(inner, inner1 -> new RegisteredServerImpl(inner1, this.manager())); + } + + public PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context) { + PagedIterable inner = + this.serviceClient().listByStorageSyncService(resourceGroupName, storageSyncServiceName, context); + return Utils.mapPage(inner, inner1 -> new RegisteredServerImpl(inner1, this.manager())); + } + + public RegisteredServer get(String resourceGroupName, String storageSyncServiceName, String serverId) { + RegisteredServerInner inner = this.serviceClient().get(resourceGroupName, storageSyncServiceName, serverId); + if (inner != null) { + return new RegisteredServerImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String storageSyncServiceName, String serverId, Context context) { + RegisteredServersGetResponse inner = + this.serviceClient().getWithResponse(resourceGroupName, storageSyncServiceName, serverId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RegisteredServerImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String storageSyncServiceName, String serverId) { + this.serviceClient().delete(resourceGroupName, storageSyncServiceName, serverId); + } + + public void delete(String resourceGroupName, String storageSyncServiceName, String serverId, Context context) { + this.serviceClient().delete(resourceGroupName, storageSyncServiceName, serverId, context); + } + + public void triggerRollover( + String resourceGroupName, String storageSyncServiceName, String serverId, TriggerRolloverRequest parameters) { + this.serviceClient().triggerRollover(resourceGroupName, storageSyncServiceName, serverId, parameters); + } + + public void triggerRollover( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + TriggerRolloverRequest parameters, + Context context) { + this.serviceClient().triggerRollover(resourceGroupName, storageSyncServiceName, serverId, parameters, context); + } + + public RegisteredServer getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String serverId = Utils.getValueFromIdByName(id, "registeredServers"); + if (serverId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'registeredServers'.", id))); + } + return this.getWithResponse(resourceGroupName, storageSyncServiceName, serverId, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String serverId = Utils.getValueFromIdByName(id, "registeredServers"); + if (serverId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'registeredServers'.", id))); + } + return this.getWithResponse(resourceGroupName, storageSyncServiceName, serverId, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String serverId = Utils.getValueFromIdByName(id, "registeredServers"); + if (serverId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'registeredServers'.", id))); + } + this.delete(resourceGroupName, storageSyncServiceName, serverId, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String serverId = Utils.getValueFromIdByName(id, "registeredServers"); + if (serverId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'registeredServers'.", id))); + } + this.delete(resourceGroupName, storageSyncServiceName, serverId, context); + } + + private RegisteredServersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } + + public RegisteredServerImpl define(String name) { + return new RegisteredServerImpl(name, this.manager()); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointImpl.java new file mode 100644 index 0000000000000..6274c8575dbb6 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointImpl.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.fluent.models.ServerEndpointInner; +import com.azure.resourcemanager.storagesync.models.FeatureStatus; +import com.azure.resourcemanager.storagesync.models.InitialDownloadPolicy; +import com.azure.resourcemanager.storagesync.models.InitialUploadPolicy; +import com.azure.resourcemanager.storagesync.models.LocalCacheMode; +import com.azure.resourcemanager.storagesync.models.RecallActionParameters; +import com.azure.resourcemanager.storagesync.models.ServerEndpoint; +import com.azure.resourcemanager.storagesync.models.ServerEndpointCloudTieringStatus; +import com.azure.resourcemanager.storagesync.models.ServerEndpointCreateParameters; +import com.azure.resourcemanager.storagesync.models.ServerEndpointRecallStatus; +import com.azure.resourcemanager.storagesync.models.ServerEndpointSyncStatus; +import com.azure.resourcemanager.storagesync.models.ServerEndpointUpdateParameters; + +public final class ServerEndpointImpl implements ServerEndpoint, ServerEndpoint.Definition, ServerEndpoint.Update { + private ServerEndpointInner innerObject; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String serverLocalPath() { + return this.innerModel().serverLocalPath(); + } + + public FeatureStatus cloudTiering() { + return this.innerModel().cloudTiering(); + } + + public Integer volumeFreeSpacePercent() { + return this.innerModel().volumeFreeSpacePercent(); + } + + public Integer tierFilesOlderThanDays() { + return this.innerModel().tierFilesOlderThanDays(); + } + + public String friendlyName() { + return this.innerModel().friendlyName(); + } + + public String serverResourceId() { + return this.innerModel().serverResourceId(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String lastWorkflowId() { + return this.innerModel().lastWorkflowId(); + } + + public String lastOperationName() { + return this.innerModel().lastOperationName(); + } + + public ServerEndpointSyncStatus syncStatus() { + return this.innerModel().syncStatus(); + } + + public FeatureStatus offlineDataTransfer() { + return this.innerModel().offlineDataTransfer(); + } + + public String offlineDataTransferStorageAccountResourceId() { + return this.innerModel().offlineDataTransferStorageAccountResourceId(); + } + + public String offlineDataTransferStorageAccountTenantId() { + return this.innerModel().offlineDataTransferStorageAccountTenantId(); + } + + public String offlineDataTransferShareName() { + return this.innerModel().offlineDataTransferShareName(); + } + + public ServerEndpointCloudTieringStatus cloudTieringStatus() { + return this.innerModel().cloudTieringStatus(); + } + + public ServerEndpointRecallStatus recallStatus() { + return this.innerModel().recallStatus(); + } + + public InitialDownloadPolicy initialDownloadPolicy() { + return this.innerModel().initialDownloadPolicy(); + } + + public LocalCacheMode localCacheMode() { + return this.innerModel().localCacheMode(); + } + + public InitialUploadPolicy initialUploadPolicy() { + return this.innerModel().initialUploadPolicy(); + } + + public String serverName() { + return this.innerModel().serverName(); + } + + public ServerEndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String storageSyncServiceName; + + private String syncGroupName; + + private String serverEndpointName; + + private ServerEndpointCreateParameters createParameters; + + private ServerEndpointUpdateParameters updateParameters; + + public ServerEndpointImpl withExistingSyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + this.resourceGroupName = resourceGroupName; + this.storageSyncServiceName = storageSyncServiceName; + this.syncGroupName = syncGroupName; + return this; + } + + public ServerEndpoint create() { + this.innerObject = + serviceManager + .serviceClient() + .getServerEndpoints() + .create( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + serverEndpointName, + createParameters, + Context.NONE); + return this; + } + + public ServerEndpoint create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServerEndpoints() + .create( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + serverEndpointName, + createParameters, + context); + return this; + } + + ServerEndpointImpl(String name, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = new ServerEndpointInner(); + this.serviceManager = serviceManager; + this.serverEndpointName = name; + this.createParameters = new ServerEndpointCreateParameters(); + } + + public ServerEndpointImpl update() { + this.updateParameters = new ServerEndpointUpdateParameters(); + return this; + } + + public ServerEndpoint apply() { + this.innerObject = + serviceManager + .serviceClient() + .getServerEndpoints() + .update( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + serverEndpointName, + updateParameters, + Context.NONE); + return this; + } + + public ServerEndpoint apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServerEndpoints() + .update( + resourceGroupName, + storageSyncServiceName, + syncGroupName, + serverEndpointName, + updateParameters, + context); + return this; + } + + ServerEndpointImpl( + ServerEndpointInner innerObject, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.storageSyncServiceName = Utils.getValueFromIdByName(innerObject.id(), "storageSyncServices"); + this.syncGroupName = Utils.getValueFromIdByName(innerObject.id(), "syncGroups"); + this.serverEndpointName = Utils.getValueFromIdByName(innerObject.id(), "serverEndpoints"); + } + + public ServerEndpoint refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getServerEndpoints() + .getWithResponse( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, Context.NONE) + .getValue(); + return this; + } + + public ServerEndpoint refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServerEndpoints() + .getWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, context) + .getValue(); + return this; + } + + public void recallAction(RecallActionParameters parameters) { + serviceManager + .serverEndpoints() + .recallAction(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters); + } + + public void recallAction(RecallActionParameters parameters, Context context) { + serviceManager + .serverEndpoints() + .recallAction( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, context); + } + + public ServerEndpointImpl withServerLocalPath(String serverLocalPath) { + this.createParameters.withServerLocalPath(serverLocalPath); + return this; + } + + public ServerEndpointImpl withCloudTiering(FeatureStatus cloudTiering) { + if (isInCreateMode()) { + this.createParameters.withCloudTiering(cloudTiering); + return this; + } else { + this.updateParameters.withCloudTiering(cloudTiering); + return this; + } + } + + public ServerEndpointImpl withVolumeFreeSpacePercent(Integer volumeFreeSpacePercent) { + if (isInCreateMode()) { + this.createParameters.withVolumeFreeSpacePercent(volumeFreeSpacePercent); + return this; + } else { + this.updateParameters.withVolumeFreeSpacePercent(volumeFreeSpacePercent); + return this; + } + } + + public ServerEndpointImpl withTierFilesOlderThanDays(Integer tierFilesOlderThanDays) { + if (isInCreateMode()) { + this.createParameters.withTierFilesOlderThanDays(tierFilesOlderThanDays); + return this; + } else { + this.updateParameters.withTierFilesOlderThanDays(tierFilesOlderThanDays); + return this; + } + } + + public ServerEndpointImpl withFriendlyName(String friendlyName) { + this.createParameters.withFriendlyName(friendlyName); + return this; + } + + public ServerEndpointImpl withServerResourceId(String serverResourceId) { + this.createParameters.withServerResourceId(serverResourceId); + return this; + } + + public ServerEndpointImpl withOfflineDataTransfer(FeatureStatus offlineDataTransfer) { + if (isInCreateMode()) { + this.createParameters.withOfflineDataTransfer(offlineDataTransfer); + return this; + } else { + this.updateParameters.withOfflineDataTransfer(offlineDataTransfer); + return this; + } + } + + public ServerEndpointImpl withOfflineDataTransferShareName(String offlineDataTransferShareName) { + if (isInCreateMode()) { + this.createParameters.withOfflineDataTransferShareName(offlineDataTransferShareName); + return this; + } else { + this.updateParameters.withOfflineDataTransferShareName(offlineDataTransferShareName); + return this; + } + } + + public ServerEndpointImpl withInitialDownloadPolicy(InitialDownloadPolicy initialDownloadPolicy) { + this.createParameters.withInitialDownloadPolicy(initialDownloadPolicy); + return this; + } + + public ServerEndpointImpl withLocalCacheMode(LocalCacheMode localCacheMode) { + if (isInCreateMode()) { + this.createParameters.withLocalCacheMode(localCacheMode); + return this; + } else { + this.updateParameters.withLocalCacheMode(localCacheMode); + return this; + } + } + + public ServerEndpointImpl withInitialUploadPolicy(InitialUploadPolicy initialUploadPolicy) { + this.createParameters.withInitialUploadPolicy(initialUploadPolicy); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointsClientImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointsClientImpl.java new file mode 100644 index 0000000000000..86e313b793764 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointsClientImpl.java @@ -0,0 +1,2004 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storagesync.fluent.ServerEndpointsClient; +import com.azure.resourcemanager.storagesync.fluent.models.ServerEndpointInner; +import com.azure.resourcemanager.storagesync.models.RecallActionParameters; +import com.azure.resourcemanager.storagesync.models.ServerEndpointCreateParameters; +import com.azure.resourcemanager.storagesync.models.ServerEndpointUpdateParameters; +import com.azure.resourcemanager.storagesync.models.ServerEndpointsGetResponse; +import com.azure.resourcemanager.storagesync.models.ServerEndpointsListBySyncGroupResponse; +import com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException; +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 ServerEndpointsClient. */ +public final class ServerEndpointsClientImpl implements ServerEndpointsClient { + private final ClientLogger logger = new ClientLogger(ServerEndpointsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ServerEndpointsService service; + + /** The service client containing this operation class. */ + private final MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of ServerEndpointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServerEndpointsClientImpl(MicrosoftStorageSyncImpl client) { + this.service = + RestProxy.create(ServerEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftStorageSyncServerEndpoints to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftStorageSync") + private interface ServerEndpointsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints" + + "/{serverEndpointName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @PathParam("serverEndpointName") String serverEndpointName, + @BodyParam("application/json") ServerEndpointCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints" + + "/{serverEndpointName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @PathParam("serverEndpointName") String serverEndpointName, + @BodyParam("application/json") ServerEndpointUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints" + + "/{serverEndpointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @PathParam("serverEndpointName") String serverEndpointName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints" + + "/{serverEndpointName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @PathParam("serverEndpointName") String serverEndpointName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono listBySyncGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/serverEndpoints" + + "/{serverEndpointName}/recallAction") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> recallAction( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @PathParam("serverEndpointName") String serverEndpointName, + @BodyParam("application/json") RecallActionParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointCreateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (serverEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serverEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + serverEndpointName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointCreateParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (serverEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serverEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + serverEndpointName, + parameters, + accept, + context); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ServerEndpointInner> beginCreateAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointCreateParameters parameters) { + Mono>> mono = + createWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServerEndpointInner.class, + ServerEndpointInner.class, + Context.NONE); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ServerEndpointInner> beginCreateAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointCreateParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ServerEndpointInner.class, ServerEndpointInner.class, context); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServerEndpointInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointCreateParameters parameters) { + return beginCreateAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters) + .getSyncPoller(); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServerEndpointInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointCreateParameters parameters, + Context context) { + return beginCreateAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, context) + .getSyncPoller(); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointCreateParameters parameters) { + return beginCreateAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointCreateParameters parameters, + Context context) { + return beginCreateAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerEndpointInner create( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointCreateParameters parameters) { + return createAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters) + .block(); + } + + /** + * Create a new ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerEndpointInner create( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointCreateParameters parameters, + Context context) { + return createAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, context) + .block(); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (serverEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serverEndpointName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + serverEndpointName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointUpdateParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (serverEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serverEndpointName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + serverEndpointName, + parameters, + accept, + context); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ServerEndpointInner> beginUpdateAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointUpdateParameters parameters) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServerEndpointInner.class, + ServerEndpointInner.class, + Context.NONE); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ServerEndpointInner> beginUpdateAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointUpdateParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ServerEndpointInner.class, ServerEndpointInner.class, context); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServerEndpointInner> beginUpdate( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointUpdateParameters parameters) { + return beginUpdateAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters) + .getSyncPoller(); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServerEndpointInner> beginUpdate( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointUpdateParameters parameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, context) + .getSyncPoller(); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointUpdateParameters parameters) { + return beginUpdateAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + final ServerEndpointUpdateParameters parameters = null; + return beginUpdateAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointUpdateParameters parameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerEndpointInner update( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointUpdateParameters parameters) { + return updateAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters) + .block(); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerEndpointInner update( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + final ServerEndpointUpdateParameters parameters = null; + return updateAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters) + .block(); + } + + /** + * Patch a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Any of the properties applicable in PUT request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerEndpointInner update( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + ServerEndpointUpdateParameters parameters, + Context context) { + return updateAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, context) + .block(); + } + + /** + * Get a ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (serverEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serverEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + serverEndpointName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (serverEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serverEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + serverEndpointName, + accept, + context); + } + + /** + * Get a ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName) + .flatMap( + (ServerEndpointsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerEndpointInner get( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return getAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).block(); + } + + /** + * Get a ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerEndpointsGetResponse getWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + Context context) { + return getWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, context) + .block(); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (serverEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serverEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + serverEndpointName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (serverEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serverEndpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + serverEndpointName, + accept, + context); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName) + .getSyncPoller(); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + Context context) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, context) + .getSyncPoller(); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + Context context) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 storageSyncServiceName, String syncGroupName, String serverEndpointName) { + deleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName).block(); + } + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + Context context) { + deleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, context).block(); + } + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySyncGroupSinglePageAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBySyncGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint list. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySyncGroupSinglePageAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySyncGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())); + } + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySyncGroupAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return new PagedFlux<>( + () -> listBySyncGroupSinglePageAsync(resourceGroupName, storageSyncServiceName, syncGroupName)); + } + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySyncGroupAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context) { + return new PagedFlux<>( + () -> listBySyncGroupSinglePageAsync(resourceGroupName, storageSyncServiceName, syncGroupName, context)); + } + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return new PagedIterable<>(listBySyncGroupAsync(resourceGroupName, storageSyncServiceName, syncGroupName)); + } + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint list. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context) { + return new PagedIterable<>( + listBySyncGroupAsync(resourceGroupName, storageSyncServiceName, syncGroupName, context)); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> recallActionWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (serverEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serverEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .recallAction( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + serverEndpointName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> recallActionWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (serverEndpointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serverEndpointName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .recallAction( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + serverEndpointName, + parameters, + accept, + context); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRecallActionAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters) { + Mono>> mono = + recallActionWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRecallActionAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + recallActionWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRecallAction( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters) { + return beginRecallActionAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters) + .getSyncPoller(); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRecallAction( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters, + Context context) { + return beginRecallActionAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, context) + .getSyncPoller(); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono recallActionAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters) { + return beginRecallActionAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono recallActionAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters, + Context context) { + return beginRecallActionAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 recallAction( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters) { + recallActionAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters) + .block(); + } + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 recallAction( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters, + Context context) { + recallActionAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, context) + .block(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointsImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointsImpl.java new file mode 100644 index 0000000000000..02018f56c65ac --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointsImpl.java @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.fluent.ServerEndpointsClient; +import com.azure.resourcemanager.storagesync.fluent.models.ServerEndpointInner; +import com.azure.resourcemanager.storagesync.models.RecallActionParameters; +import com.azure.resourcemanager.storagesync.models.ServerEndpoint; +import com.azure.resourcemanager.storagesync.models.ServerEndpoints; +import com.azure.resourcemanager.storagesync.models.ServerEndpointsGetResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServerEndpointsImpl implements ServerEndpoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointsImpl.class); + + private final ServerEndpointsClient innerClient; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + public ServerEndpointsImpl( + ServerEndpointsClient innerClient, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ServerEndpoint get( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + ServerEndpointInner inner = + this.serviceClient().get(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName); + if (inner != null) { + return new ServerEndpointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + Context context) { + ServerEndpointsGetResponse inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServerEndpointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + this.serviceClient().delete(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName); + } + + public void delete( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + Context context) { + this + .serviceClient() + .delete(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, context); + } + + public PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + PagedIterable inner = + this.serviceClient().listBySyncGroup(resourceGroupName, storageSyncServiceName, syncGroupName); + return Utils.mapPage(inner, inner1 -> new ServerEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listBySyncGroup(resourceGroupName, storageSyncServiceName, syncGroupName, context); + return Utils.mapPage(inner, inner1 -> new ServerEndpointImpl(inner1, this.manager())); + } + + public void recallAction( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters) { + this + .serviceClient() + .recallAction(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters); + } + + public void recallAction( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters, + Context context) { + this + .serviceClient() + .recallAction( + resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, parameters, context); + } + + public ServerEndpoint getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String syncGroupName = Utils.getValueFromIdByName(id, "syncGroups"); + if (syncGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'syncGroups'.", id))); + } + String serverEndpointName = Utils.getValueFromIdByName(id, "serverEndpoints"); + if (serverEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'serverEndpoints'.", id))); + } + return this + .getWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String syncGroupName = Utils.getValueFromIdByName(id, "syncGroups"); + if (syncGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'syncGroups'.", id))); + } + String serverEndpointName = Utils.getValueFromIdByName(id, "serverEndpoints"); + if (serverEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'serverEndpoints'.", id))); + } + return this + .getWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String syncGroupName = Utils.getValueFromIdByName(id, "syncGroups"); + if (syncGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'syncGroups'.", id))); + } + String serverEndpointName = Utils.getValueFromIdByName(id, "serverEndpoints"); + if (serverEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'serverEndpoints'.", id))); + } + this.delete(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String syncGroupName = Utils.getValueFromIdByName(id, "syncGroups"); + if (syncGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'syncGroups'.", id))); + } + String serverEndpointName = Utils.getValueFromIdByName(id, "serverEndpoints"); + if (serverEndpointName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'serverEndpoints'.", id))); + } + this.delete(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName, context); + } + + private ServerEndpointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } + + public ServerEndpointImpl define(String name) { + return new ServerEndpointImpl(name, this.manager()); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/StorageSyncServiceImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/StorageSyncServiceImpl.java new file mode 100644 index 0000000000000..6ca89186633a4 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/StorageSyncServiceImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.storagesync.fluent.models.StorageSyncServiceInner; +import com.azure.resourcemanager.storagesync.models.IncomingTrafficPolicy; +import com.azure.resourcemanager.storagesync.models.PrivateEndpointConnection; +import com.azure.resourcemanager.storagesync.models.StorageSyncService; +import com.azure.resourcemanager.storagesync.models.StorageSyncServiceCreateParameters; +import com.azure.resourcemanager.storagesync.models.StorageSyncServiceUpdateParameters; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class StorageSyncServiceImpl + implements StorageSyncService, StorageSyncService.Definition, StorageSyncService.Update { + private StorageSyncServiceInner innerObject; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager 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 IncomingTrafficPolicy incomingTrafficPolicy() { + return this.innerModel().incomingTrafficPolicy(); + } + + public Integer storageSyncServiceStatus() { + return this.innerModel().storageSyncServiceStatus(); + } + + public String storageSyncServiceUid() { + return this.innerModel().storageSyncServiceUid(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String lastWorkflowId() { + return this.innerModel().lastWorkflowId(); + } + + public String lastOperationName() { + return this.innerModel().lastOperationName(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public StorageSyncServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String storageSyncServiceName; + + private StorageSyncServiceCreateParameters createParameters; + + private StorageSyncServiceUpdateParameters updateParameters; + + public StorageSyncServiceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public StorageSyncService create() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageSyncServices() + .create(resourceGroupName, storageSyncServiceName, createParameters, Context.NONE); + return this; + } + + public StorageSyncService create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageSyncServices() + .create(resourceGroupName, storageSyncServiceName, createParameters, context); + return this; + } + + StorageSyncServiceImpl(String name, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = new StorageSyncServiceInner(); + this.serviceManager = serviceManager; + this.storageSyncServiceName = name; + this.createParameters = new StorageSyncServiceCreateParameters(); + } + + public StorageSyncServiceImpl update() { + this.updateParameters = new StorageSyncServiceUpdateParameters(); + return this; + } + + public StorageSyncService apply() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageSyncServices() + .update(resourceGroupName, storageSyncServiceName, updateParameters, Context.NONE); + return this; + } + + public StorageSyncService apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageSyncServices() + .update(resourceGroupName, storageSyncServiceName, updateParameters, context); + return this; + } + + StorageSyncServiceImpl( + StorageSyncServiceInner innerObject, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.storageSyncServiceName = Utils.getValueFromIdByName(innerObject.id(), "storageSyncServices"); + } + + public StorageSyncService refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getStorageSyncServices() + .getByResourceGroupWithResponse(resourceGroupName, storageSyncServiceName, Context.NONE) + .getValue(); + return this; + } + + public StorageSyncService refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorageSyncServices() + .getByResourceGroupWithResponse(resourceGroupName, storageSyncServiceName, context) + .getValue(); + return this; + } + + public StorageSyncServiceImpl withRegion(Region location) { + this.createParameters.withLocation(location.toString()); + return this; + } + + public StorageSyncServiceImpl withRegion(String location) { + this.createParameters.withLocation(location); + return this; + } + + public StorageSyncServiceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameters.withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public StorageSyncServiceImpl withIncomingTrafficPolicy(IncomingTrafficPolicy incomingTrafficPolicy) { + if (isInCreateMode()) { + this.createParameters.withIncomingTrafficPolicy(incomingTrafficPolicy); + return this; + } else { + this.updateParameters.withIncomingTrafficPolicy(incomingTrafficPolicy); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/StorageSyncServicesClientImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/StorageSyncServicesClientImpl.java new file mode 100644 index 0000000000000..b05f0ae0928b3 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/StorageSyncServicesClientImpl.java @@ -0,0 +1,1631 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storagesync.fluent.StorageSyncServicesClient; +import com.azure.resourcemanager.storagesync.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.storagesync.fluent.models.StorageSyncServiceInner; +import com.azure.resourcemanager.storagesync.models.CheckNameAvailabilityParameters; +import com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException; +import com.azure.resourcemanager.storagesync.models.StorageSyncServiceCreateParameters; +import com.azure.resourcemanager.storagesync.models.StorageSyncServiceUpdateParameters; +import com.azure.resourcemanager.storagesync.models.StorageSyncServicesGetByResourceGroupResponse; +import com.azure.resourcemanager.storagesync.models.StorageSyncServicesListByResourceGroupResponse; +import com.azure.resourcemanager.storagesync.models.StorageSyncServicesListResponse; +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 StorageSyncServicesClient. */ +public final class StorageSyncServicesClientImpl implements StorageSyncServicesClient { + private final ClientLogger logger = new ClientLogger(StorageSyncServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final StorageSyncServicesService service; + + /** The service client containing this operation class. */ + private final MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of StorageSyncServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StorageSyncServicesClientImpl(MicrosoftStorageSyncImpl client) { + this.service = + RestProxy.create(StorageSyncServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftStorageSyncStorageSyncServices to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftStorageSync") + private interface StorageSyncServicesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}" + + "/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("locationName") String locationName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CheckNameAvailabilityParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @BodyParam("application/json") StorageSyncServiceCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @BodyParam("application/json") StorageSyncServiceUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/storageSyncServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String locationName, CheckNameAvailabilityParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + locationName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String locationName, CheckNameAvailabilityParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + locationName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String locationName, CheckNameAvailabilityParameters parameters) { + return checkNameAvailabilityWithResponseAsync(locationName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResultInner checkNameAvailability( + String locationName, CheckNameAvailabilityParameters parameters) { + return checkNameAvailabilityAsync(locationName, parameters).block(); + } + + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String locationName, CheckNameAvailabilityParameters parameters, Context context) { + return checkNameAvailabilityWithResponseAsync(locationName, parameters, context).block(); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, StorageSyncServiceCreateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + StorageSyncServiceCreateParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + parameters, + accept, + context); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, StorageSyncServiceInner> beginCreateAsync( + String resourceGroupName, String storageSyncServiceName, StorageSyncServiceCreateParameters parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, storageSyncServiceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageSyncServiceInner.class, + StorageSyncServiceInner.class, + Context.NONE); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, StorageSyncServiceInner> beginCreateAsync( + String resourceGroupName, + String storageSyncServiceName, + StorageSyncServiceCreateParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, storageSyncServiceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageSyncServiceInner.class, + StorageSyncServiceInner.class, + context); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StorageSyncServiceInner> beginCreate( + String resourceGroupName, String storageSyncServiceName, StorageSyncServiceCreateParameters parameters) { + return beginCreateAsync(resourceGroupName, storageSyncServiceName, parameters).getSyncPoller(); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StorageSyncServiceInner> beginCreate( + String resourceGroupName, + String storageSyncServiceName, + StorageSyncServiceCreateParameters parameters, + Context context) { + return beginCreateAsync(resourceGroupName, storageSyncServiceName, parameters, context).getSyncPoller(); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String storageSyncServiceName, StorageSyncServiceCreateParameters parameters) { + return beginCreateAsync(resourceGroupName, storageSyncServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String storageSyncServiceName, + StorageSyncServiceCreateParameters parameters, + Context context) { + return beginCreateAsync(resourceGroupName, storageSyncServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageSyncServiceInner create( + String resourceGroupName, String storageSyncServiceName, StorageSyncServiceCreateParameters parameters) { + return createAsync(resourceGroupName, storageSyncServiceName, parameters).block(); + } + + /** + * Create a new StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageSyncServiceInner create( + String resourceGroupName, + String storageSyncServiceName, + StorageSyncServiceCreateParameters parameters, + Context context) { + return createAsync(resourceGroupName, storageSyncServiceName, parameters, context).block(); + } + + /** + * Get a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given StorageSyncService. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupWithResponseAsync( + String resourceGroupName, String storageSyncServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storageSyncServiceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given StorageSyncService. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + storageSyncServiceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given StorageSyncService. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String storageSyncServiceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, storageSyncServiceName) + .flatMap( + (StorageSyncServicesGetByResourceGroupResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given StorageSyncService. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageSyncServiceInner getByResourceGroup(String resourceGroupName, String storageSyncServiceName) { + return getByResourceGroupAsync(resourceGroupName, storageSyncServiceName).block(); + } + + /** + * Get a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given StorageSyncService. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageSyncServicesGetByResourceGroupResponse getByResourceGroupWithResponse( + String resourceGroupName, String storageSyncServiceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, storageSyncServiceName, context).block(); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, StorageSyncServiceUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + StorageSyncServiceUpdateParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + parameters, + accept, + context); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, StorageSyncServiceInner> beginUpdateAsync( + String resourceGroupName, String storageSyncServiceName, StorageSyncServiceUpdateParameters parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, storageSyncServiceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageSyncServiceInner.class, + StorageSyncServiceInner.class, + Context.NONE); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, StorageSyncServiceInner> beginUpdateAsync( + String resourceGroupName, + String storageSyncServiceName, + StorageSyncServiceUpdateParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, storageSyncServiceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageSyncServiceInner.class, + StorageSyncServiceInner.class, + context); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StorageSyncServiceInner> beginUpdate( + String resourceGroupName, String storageSyncServiceName, StorageSyncServiceUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, storageSyncServiceName, parameters).getSyncPoller(); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StorageSyncServiceInner> beginUpdate( + String resourceGroupName, + String storageSyncServiceName, + StorageSyncServiceUpdateParameters parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, storageSyncServiceName, parameters, context).getSyncPoller(); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String storageSyncServiceName, StorageSyncServiceUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, storageSyncServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String storageSyncServiceName) { + final StorageSyncServiceUpdateParameters parameters = null; + return beginUpdateAsync(resourceGroupName, storageSyncServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String storageSyncServiceName, + StorageSyncServiceUpdateParameters parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, storageSyncServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageSyncServiceInner update( + String resourceGroupName, String storageSyncServiceName, StorageSyncServiceUpdateParameters parameters) { + return updateAsync(resourceGroupName, storageSyncServiceName, parameters).block(); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageSyncServiceInner update(String resourceGroupName, String storageSyncServiceName) { + final StorageSyncServiceUpdateParameters parameters = null; + return updateAsync(resourceGroupName, storageSyncServiceName, parameters).block(); + } + + /** + * Patch a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param parameters Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageSyncServiceInner update( + String resourceGroupName, + String storageSyncServiceName, + StorageSyncServiceUpdateParameters parameters, + Context context) { + return updateAsync(resourceGroupName, storageSyncServiceName, parameters, context).block(); + } + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String storageSyncServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + accept, + context); + } + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String storageSyncServiceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, storageSyncServiceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String storageSyncServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, storageSyncServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String storageSyncServiceName) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName).getSyncPoller(); + } + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String storageSyncServiceName, Context context) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, context).getSyncPoller(); + } + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String storageSyncServiceName) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String storageSyncServiceName, Context context) { + return beginDeleteAsync(resourceGroupName, storageSyncServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 storageSyncServiceName) { + deleteAsync(resourceGroupName, storageSyncServiceName).block(); + } + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 storageSyncServiceName, Context context) { + deleteAsync(resourceGroupName, storageSyncServiceName, context).block(); + } + + /** + * Get a StorageSyncService list by Resource group name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by Resource group name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a StorageSyncService list by Resource group name. + * + * @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 StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by Resource group name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())); + } + + /** + * Get a StorageSyncService list by Resource group name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by Resource group name. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + } + + /** + * Get a StorageSyncService list by Resource group name. + * + * @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 StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by Resource group name. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + } + + /** + * Get a StorageSyncService list by Resource group name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by Resource group name. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Get a StorageSyncService list by Resource group name. + * + * @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 StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by Resource group name. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a StorageSyncService list by subscription. + * + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a StorageSyncService list by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())); + } + + /** + * Get a StorageSyncService list by subscription. + * + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Get a StorageSyncService list by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Get a StorageSyncService list by subscription. + * + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get a StorageSyncService list by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/StorageSyncServicesImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/StorageSyncServicesImpl.java new file mode 100644 index 0000000000000..5cda8dbd8e6e4 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/StorageSyncServicesImpl.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.fluent.StorageSyncServicesClient; +import com.azure.resourcemanager.storagesync.fluent.models.CheckNameAvailabilityResultInner; +import com.azure.resourcemanager.storagesync.fluent.models.StorageSyncServiceInner; +import com.azure.resourcemanager.storagesync.models.CheckNameAvailabilityParameters; +import com.azure.resourcemanager.storagesync.models.CheckNameAvailabilityResult; +import com.azure.resourcemanager.storagesync.models.StorageSyncService; +import com.azure.resourcemanager.storagesync.models.StorageSyncServices; +import com.azure.resourcemanager.storagesync.models.StorageSyncServicesGetByResourceGroupResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class StorageSyncServicesImpl implements StorageSyncServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageSyncServicesImpl.class); + + private final StorageSyncServicesClient innerClient; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + public StorageSyncServicesImpl( + StorageSyncServicesClient innerClient, + com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameAvailabilityResult checkNameAvailability( + String locationName, CheckNameAvailabilityParameters parameters) { + CheckNameAvailabilityResultInner inner = this.serviceClient().checkNameAvailability(locationName, parameters); + if (inner != null) { + return new CheckNameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String locationName, CheckNameAvailabilityParameters parameters, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(locationName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageSyncService getByResourceGroup(String resourceGroupName, String storageSyncServiceName) { + StorageSyncServiceInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, storageSyncServiceName); + if (inner != null) { + return new StorageSyncServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String storageSyncServiceName, Context context) { + StorageSyncServicesGetByResourceGroupResponse inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, storageSyncServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StorageSyncServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String storageSyncServiceName) { + this.serviceClient().delete(resourceGroupName, storageSyncServiceName); + } + + public void delete(String resourceGroupName, String storageSyncServiceName, Context context) { + this.serviceClient().delete(resourceGroupName, storageSyncServiceName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new StorageSyncServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new StorageSyncServiceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new StorageSyncServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new StorageSyncServiceImpl(inner1, this.manager())); + } + + public StorageSyncService getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, storageSyncServiceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, storageSyncServiceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + this.delete(resourceGroupName, storageSyncServiceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + this.delete(resourceGroupName, storageSyncServiceName, context); + } + + private StorageSyncServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } + + public StorageSyncServiceImpl define(String name) { + return new StorageSyncServiceImpl(name, this.manager()); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/SyncGroupImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/SyncGroupImpl.java new file mode 100644 index 0000000000000..b3fd649c20aea --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/SyncGroupImpl.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.fluent.models.SyncGroupInner; +import com.azure.resourcemanager.storagesync.models.SyncGroup; +import com.azure.resourcemanager.storagesync.models.SyncGroupCreateParameters; + +public final class SyncGroupImpl implements SyncGroup, SyncGroup.Definition { + private SyncGroupInner innerObject; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + SyncGroupImpl(SyncGroupInner innerObject, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String uniqueId() { + return this.innerModel().uniqueId(); + } + + public String syncGroupStatus() { + return this.innerModel().syncGroupStatus(); + } + + public SyncGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String storageSyncServiceName; + + private String syncGroupName; + + private SyncGroupCreateParameters createParameters; + + public SyncGroupImpl withExistingStorageSyncService(String resourceGroupName, String storageSyncServiceName) { + this.resourceGroupName = resourceGroupName; + this.storageSyncServiceName = storageSyncServiceName; + return this; + } + + public SyncGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getSyncGroups() + .createWithResponse( + resourceGroupName, storageSyncServiceName, syncGroupName, createParameters, Context.NONE) + .getValue(); + return this; + } + + public SyncGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSyncGroups() + .createWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, createParameters, context) + .getValue(); + return this; + } + + SyncGroupImpl(String name, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = new SyncGroupInner(); + this.serviceManager = serviceManager; + this.syncGroupName = name; + this.createParameters = new SyncGroupCreateParameters(); + } + + public SyncGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSyncGroups() + .getWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, Context.NONE) + .getValue(); + return this; + } + + public SyncGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSyncGroups() + .getWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, context) + .getValue(); + return this; + } + + public SyncGroupImpl withProperties(Object properties) { + this.createParameters.withProperties(properties); + return this; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/SyncGroupsClientImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/SyncGroupsClientImpl.java new file mode 100644 index 0000000000000..02e6dda643ac1 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/SyncGroupsClientImpl.java @@ -0,0 +1,844 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.fluent.SyncGroupsClient; +import com.azure.resourcemanager.storagesync.fluent.models.SyncGroupInner; +import com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException; +import com.azure.resourcemanager.storagesync.models.SyncGroupCreateParameters; +import com.azure.resourcemanager.storagesync.models.SyncGroupsCreateResponse; +import com.azure.resourcemanager.storagesync.models.SyncGroupsDeleteResponse; +import com.azure.resourcemanager.storagesync.models.SyncGroupsGetResponse; +import com.azure.resourcemanager.storagesync.models.SyncGroupsListByStorageSyncServiceResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SyncGroupsClient. */ +public final class SyncGroupsClientImpl implements SyncGroupsClient { + private final ClientLogger logger = new ClientLogger(SyncGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SyncGroupsService service; + + /** The service client containing this operation class. */ + private final MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of SyncGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SyncGroupsClientImpl(MicrosoftStorageSyncImpl client) { + this.service = + RestProxy.create(SyncGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftStorageSyncSyncGroups to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftStorageSync") + private interface SyncGroupsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono listByStorageSyncService( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @BodyParam("application/json") SyncGroupCreateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("syncGroupName") String syncGroupName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SyncGroup List. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageSyncServiceSinglePageAsync( + String resourceGroupName, String storageSyncServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByStorageSyncService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SyncGroup List. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageSyncServiceSinglePageAsync( + String resourceGroupName, String storageSyncServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByStorageSyncService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())); + } + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SyncGroup List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByStorageSyncServiceAsync( + String resourceGroupName, String storageSyncServiceName) { + return new PagedFlux<>( + () -> listByStorageSyncServiceSinglePageAsync(resourceGroupName, storageSyncServiceName)); + } + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SyncGroup List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByStorageSyncServiceAsync( + String resourceGroupName, String storageSyncServiceName, Context context) { + return new PagedFlux<>( + () -> listByStorageSyncServiceSinglePageAsync(resourceGroupName, storageSyncServiceName, context)); + } + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SyncGroup List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName) { + return new PagedIterable<>(listByStorageSyncServiceAsync(resourceGroupName, storageSyncServiceName)); + } + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SyncGroup List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context) { + return new PagedIterable<>(listByStorageSyncServiceAsync(resourceGroupName, storageSyncServiceName, context)); + } + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param parameters Sync Group Body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sync Group object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + SyncGroupCreateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param parameters Sync Group Body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sync Group object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createWithResponseAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + SyncGroupCreateParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + parameters, + accept, + context); + } + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param parameters Sync Group Body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sync Group object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + SyncGroupCreateParameters parameters) { + return createWithResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, parameters) + .flatMap( + (SyncGroupsCreateResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param parameters Sync Group Body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sync Group object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncGroupInner create( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + SyncGroupCreateParameters parameters) { + return createAsync(resourceGroupName, storageSyncServiceName, syncGroupName, parameters).block(); + } + + /** + * Create a new SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param parameters Sync Group Body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sync Group object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncGroupsCreateResponse createWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + SyncGroupCreateParameters parameters, + Context context) { + return createWithResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, parameters, context) + .block(); + } + + /** + * Get a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given SyncGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given SyncGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + accept, + context); + } + + /** + * Get a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given SyncGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName) + .flatMap( + (SyncGroupsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given SyncGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncGroupInner get(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return getAsync(resourceGroupName, storageSyncServiceName, syncGroupName).block(); + } + + /** + * Get a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given SyncGroup. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncGroupsGetResponse getWithResponse( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, context).block(); + } + + /** + * Delete a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (syncGroupName == null) { + return Mono.error(new IllegalArgumentException("Parameter syncGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + accept, + context); + } + + /** + * Delete a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return deleteWithResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName) + .flatMap((SyncGroupsDeleteResponse res) -> Mono.empty()); + } + + /** + * Delete a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 storageSyncServiceName, String syncGroupName) { + deleteAsync(resourceGroupName, storageSyncServiceName, syncGroupName).block(); + } + + /** + * Delete a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 SyncGroupsDeleteResponse deleteWithResponse( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context) { + return deleteWithResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, context).block(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/SyncGroupsImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/SyncGroupsImpl.java new file mode 100644 index 0000000000000..530baf9cc53d9 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/SyncGroupsImpl.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.fluent.SyncGroupsClient; +import com.azure.resourcemanager.storagesync.fluent.models.SyncGroupInner; +import com.azure.resourcemanager.storagesync.models.SyncGroup; +import com.azure.resourcemanager.storagesync.models.SyncGroups; +import com.azure.resourcemanager.storagesync.models.SyncGroupsDeleteResponse; +import com.azure.resourcemanager.storagesync.models.SyncGroupsGetResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SyncGroupsImpl implements SyncGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SyncGroupsImpl.class); + + private final SyncGroupsClient innerClient; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + public SyncGroupsImpl( + SyncGroupsClient innerClient, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByStorageSyncService(String resourceGroupName, String storageSyncServiceName) { + PagedIterable inner = + this.serviceClient().listByStorageSyncService(resourceGroupName, storageSyncServiceName); + return Utils.mapPage(inner, inner1 -> new SyncGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context) { + PagedIterable inner = + this.serviceClient().listByStorageSyncService(resourceGroupName, storageSyncServiceName, context); + return Utils.mapPage(inner, inner1 -> new SyncGroupImpl(inner1, this.manager())); + } + + public SyncGroup get(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + SyncGroupInner inner = this.serviceClient().get(resourceGroupName, storageSyncServiceName, syncGroupName); + if (inner != null) { + return new SyncGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context) { + SyncGroupsGetResponse inner = + this.serviceClient().getWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SyncGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + this.serviceClient().delete(resourceGroupName, storageSyncServiceName, syncGroupName); + } + + public SyncGroupsDeleteResponse deleteWithResponse( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, context); + } + + public SyncGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String syncGroupName = Utils.getValueFromIdByName(id, "syncGroups"); + if (syncGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'syncGroups'.", id))); + } + return this.getWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String syncGroupName = Utils.getValueFromIdByName(id, "syncGroups"); + if (syncGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'syncGroups'.", id))); + } + return this.getWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String syncGroupName = Utils.getValueFromIdByName(id, "syncGroups"); + if (syncGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'syncGroups'.", id))); + } + this.deleteWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, Context.NONE).getValue(); + } + + public SyncGroupsDeleteResponse deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String storageSyncServiceName = Utils.getValueFromIdByName(id, "storageSyncServices"); + if (storageSyncServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'storageSyncServices'.", id))); + } + String syncGroupName = Utils.getValueFromIdByName(id, "syncGroups"); + if (syncGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'syncGroups'.", id))); + } + return this.deleteWithResponse(resourceGroupName, storageSyncServiceName, syncGroupName, context); + } + + private SyncGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } + + public SyncGroupImpl define(String name) { + return new SyncGroupImpl(name, this.manager()); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/Utils.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/Utils.java new file mode 100644 index 0000000000000..d3ccfc9d8d3b2 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/WorkflowImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/WorkflowImpl.java new file mode 100644 index 0000000000000..f1e1e2d70d037 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/WorkflowImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.implementation; + +import com.azure.resourcemanager.storagesync.fluent.models.WorkflowInner; +import com.azure.resourcemanager.storagesync.models.OperationDirection; +import com.azure.resourcemanager.storagesync.models.Workflow; +import com.azure.resourcemanager.storagesync.models.WorkflowStatus; +import java.time.OffsetDateTime; + +public final class WorkflowImpl implements Workflow { + private WorkflowInner innerObject; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + WorkflowImpl(WorkflowInner innerObject, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String lastStepName() { + return this.innerModel().lastStepName(); + } + + public WorkflowStatus status() { + return this.innerModel().status(); + } + + public OperationDirection operation() { + return this.innerModel().operation(); + } + + public String steps() { + return this.innerModel().steps(); + } + + public String lastOperationId() { + return this.innerModel().lastOperationId(); + } + + public String commandName() { + return this.innerModel().commandName(); + } + + public OffsetDateTime createdTimestamp() { + return this.innerModel().createdTimestamp(); + } + + public OffsetDateTime lastStatusTimestamp() { + return this.innerModel().lastStatusTimestamp(); + } + + public WorkflowInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/WorkflowsClientImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/WorkflowsClientImpl.java new file mode 100644 index 0000000000000..1ffc7bcf7c4f5 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/WorkflowsClientImpl.java @@ -0,0 +1,619 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.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.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.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.fluent.WorkflowsClient; +import com.azure.resourcemanager.storagesync.fluent.models.WorkflowInner; +import com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException; +import com.azure.resourcemanager.storagesync.models.WorkflowsAbortResponse; +import com.azure.resourcemanager.storagesync.models.WorkflowsGetResponse; +import com.azure.resourcemanager.storagesync.models.WorkflowsListByStorageSyncServiceResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WorkflowsClient. */ +public final class WorkflowsClientImpl implements WorkflowsClient { + private final ClientLogger logger = new ClientLogger(WorkflowsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkflowsService service; + + /** The service client containing this operation class. */ + private final MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of WorkflowsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkflowsClientImpl(MicrosoftStorageSyncImpl client) { + this.service = + RestProxy.create(WorkflowsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftStorageSyncWorkflows to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftStorageSync") + private interface WorkflowsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/workflows") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono listByStorageSyncService( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("workflowId") String workflowId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/workflows/{workflowId}/abort") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono abort( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("storageSyncServiceName") String storageSyncServiceName, + @PathParam("workflowId") String workflowId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a Workflow List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workflow List. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageSyncServiceSinglePageAsync( + String resourceGroupName, String storageSyncServiceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByStorageSyncService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Workflow List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workflow List. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByStorageSyncServiceSinglePageAsync( + String resourceGroupName, String storageSyncServiceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByStorageSyncService( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + null, + res.getDeserializedHeaders())); + } + + /** + * Get a Workflow List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workflow List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByStorageSyncServiceAsync( + String resourceGroupName, String storageSyncServiceName) { + return new PagedFlux<>( + () -> listByStorageSyncServiceSinglePageAsync(resourceGroupName, storageSyncServiceName)); + } + + /** + * Get a Workflow List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workflow List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByStorageSyncServiceAsync( + String resourceGroupName, String storageSyncServiceName, Context context) { + return new PagedFlux<>( + () -> listByStorageSyncServiceSinglePageAsync(resourceGroupName, storageSyncServiceName, context)); + } + + /** + * Get a Workflow List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workflow List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName) { + return new PagedIterable<>(listByStorageSyncServiceAsync(resourceGroupName, storageSyncServiceName)); + } + + /** + * Get a Workflow List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workflow List. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context) { + return new PagedIterable<>(listByStorageSyncServiceAsync(resourceGroupName, storageSyncServiceName, context)); + } + + /** + * Get Workflows resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflows resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String workflowId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (workflowId == null) { + return Mono.error(new IllegalArgumentException("Parameter workflowId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + workflowId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Workflows resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflows resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String workflowId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (workflowId == null) { + return Mono.error(new IllegalArgumentException("Parameter workflowId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + workflowId, + accept, + context); + } + + /** + * Get Workflows resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflows resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String storageSyncServiceName, String workflowId) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, workflowId) + .flatMap( + (WorkflowsGetResponse res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get Workflows resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflows resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkflowInner get(String resourceGroupName, String storageSyncServiceName, String workflowId) { + return getAsync(resourceGroupName, storageSyncServiceName, workflowId).block(); + } + + /** + * Get Workflows resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflows resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkflowsGetResponse getWithResponse( + String resourceGroupName, String storageSyncServiceName, String workflowId, Context context) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, workflowId, context).block(); + } + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono abortWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String workflowId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (workflowId == null) { + return Mono.error(new IllegalArgumentException("Parameter workflowId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .abort( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + workflowId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono abortWithResponseAsync( + String resourceGroupName, String storageSyncServiceName, String workflowId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageSyncServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter storageSyncServiceName is required and cannot be null.")); + } + if (workflowId == null) { + return Mono.error(new IllegalArgumentException("Parameter workflowId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .abort( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + workflowId, + accept, + context); + } + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono abortAsync(String resourceGroupName, String storageSyncServiceName, String workflowId) { + return abortWithResponseAsync(resourceGroupName, storageSyncServiceName, workflowId) + .flatMap((WorkflowsAbortResponse res) -> Mono.empty()); + } + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 abort(String resourceGroupName, String storageSyncServiceName, String workflowId) { + abortAsync(resourceGroupName, storageSyncServiceName, workflowId).block(); + } + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws StorageSyncApiErrorException 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 WorkflowsAbortResponse abortWithResponse( + String resourceGroupName, String storageSyncServiceName, String workflowId, Context context) { + return abortWithResponseAsync(resourceGroupName, storageSyncServiceName, workflowId, context).block(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/WorkflowsImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/WorkflowsImpl.java new file mode 100644 index 0000000000000..89216b5a9b91a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/WorkflowsImpl.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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.storagesync.fluent.WorkflowsClient; +import com.azure.resourcemanager.storagesync.fluent.models.WorkflowInner; +import com.azure.resourcemanager.storagesync.models.Workflow; +import com.azure.resourcemanager.storagesync.models.Workflows; +import com.azure.resourcemanager.storagesync.models.WorkflowsAbortResponse; +import com.azure.resourcemanager.storagesync.models.WorkflowsGetResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkflowsImpl implements Workflows { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkflowsImpl.class); + + private final WorkflowsClient innerClient; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + public WorkflowsImpl( + WorkflowsClient innerClient, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByStorageSyncService(String resourceGroupName, String storageSyncServiceName) { + PagedIterable inner = + this.serviceClient().listByStorageSyncService(resourceGroupName, storageSyncServiceName); + return Utils.mapPage(inner, inner1 -> new WorkflowImpl(inner1, this.manager())); + } + + public PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context) { + PagedIterable inner = + this.serviceClient().listByStorageSyncService(resourceGroupName, storageSyncServiceName, context); + return Utils.mapPage(inner, inner1 -> new WorkflowImpl(inner1, this.manager())); + } + + public Workflow get(String resourceGroupName, String storageSyncServiceName, String workflowId) { + WorkflowInner inner = this.serviceClient().get(resourceGroupName, storageSyncServiceName, workflowId); + if (inner != null) { + return new WorkflowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String storageSyncServiceName, String workflowId, Context context) { + WorkflowsGetResponse inner = + this.serviceClient().getWithResponse(resourceGroupName, storageSyncServiceName, workflowId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkflowImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void abort(String resourceGroupName, String storageSyncServiceName, String workflowId) { + this.serviceClient().abort(resourceGroupName, storageSyncServiceName, workflowId); + } + + public WorkflowsAbortResponse abortWithResponse( + String resourceGroupName, String storageSyncServiceName, String workflowId, Context context) { + return this.serviceClient().abortWithResponse(resourceGroupName, storageSyncServiceName, workflowId, context); + } + + private WorkflowsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storagesync.StoragesyncManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/package-info.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/package-info.java new file mode 100644 index 0000000000000..4a31d00ac772d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for MicrosoftStorageSync. Microsoft Storage Sync Service API. */ +package com.azure.resourcemanager.storagesync.implementation; diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/BackupRequest.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/BackupRequest.java new file mode 100644 index 0000000000000..95bbc54d93edb --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/BackupRequest.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Backup request. */ +@Fluent +public final class BackupRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupRequest.class); + + /* + * Azure File Share. + */ + @JsonProperty(value = "azureFileShare") + private String azureFileShare; + + /** + * Get the azureFileShare property: Azure File Share. + * + * @return the azureFileShare value. + */ + public String azureFileShare() { + return this.azureFileShare; + } + + /** + * Set the azureFileShare property: Azure File Share. + * + * @param azureFileShare the azureFileShare value to set. + * @return the BackupRequest object itself. + */ + public BackupRequest withAzureFileShare(String azureFileShare) { + this.azureFileShare = azureFileShare; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ChangeDetectionMode.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ChangeDetectionMode.java new file mode 100644 index 0000000000000..4be33cd6a54e5 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ChangeDetectionMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ChangeDetectionMode. */ +public final class ChangeDetectionMode extends ExpandableStringEnum { + /** Static value Default for ChangeDetectionMode. */ + public static final ChangeDetectionMode DEFAULT = fromString("Default"); + + /** Static value Recursive for ChangeDetectionMode. */ + public static final ChangeDetectionMode RECURSIVE = fromString("Recursive"); + + /** + * Creates or finds a ChangeDetectionMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ChangeDetectionMode. + */ + @JsonCreator + public static ChangeDetectionMode fromString(String name) { + return fromString(name, ChangeDetectionMode.class); + } + + /** @return known ChangeDetectionMode values. */ + public static Collection values() { + return values(ChangeDetectionMode.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CheckNameAvailabilityParameters.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CheckNameAvailabilityParameters.java new file mode 100644 index 0000000000000..e89f8c6287f5f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CheckNameAvailabilityParameters.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters for a check name availability request. */ +@Fluent +public final class CheckNameAvailabilityParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityParameters.class); + + /* + * The name to check for availability + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The resource type. Must be set to + * Microsoft.StorageSync/storageSyncServices + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** Creates an instance of CheckNameAvailabilityParameters class. */ + public CheckNameAvailabilityParameters() { + type = "Microsoft.StorageSync/storageSyncServices"; + } + + /** + * Get the name property: The name to check for availability. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name to check for availability. + * + * @param name the name value to set. + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The resource type. Must be set to Microsoft.StorageSync/storageSyncServices. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The resource type. Must be set to Microsoft.StorageSync/storageSyncServices. + * + * @param type the type value to set. + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model CheckNameAvailabilityParameters")); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CheckNameAvailabilityResult.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CheckNameAvailabilityResult.java new file mode 100644 index 0000000000000..fba7ab20be78f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CheckNameAvailabilityResult.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.resourcemanager.storagesync.fluent.models.CheckNameAvailabilityResultInner; + +/** An immutable client-side representation of CheckNameAvailabilityResult. */ +public interface CheckNameAvailabilityResult { + /** + * Gets the nameAvailable property: Gets a boolean value that indicates whether the name is available for you to + * use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: Gets the reason that a Storage Sync Service name could not be used. The Reason element + * is only returned if NameAvailable is false. + * + * @return the reason value. + */ + NameAvailabilityReason reason(); + + /** + * Gets the message property: Gets an error message explaining the Reason value in more detail. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.storagesync.fluent.models.CheckNameAvailabilityResultInner object. + * + * @return the inner object. + */ + CheckNameAvailabilityResultInner innerModel(); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpoint.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpoint.java new file mode 100644 index 0000000000000..4f8d26ed7bd63 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpoint.java @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.fluent.models.CloudEndpointInner; + +/** An immutable client-side representation of CloudEndpoint. */ +public interface CloudEndpoint { + /** + * 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 storageAccountResourceId property: Storage Account Resource Id. + * + * @return the storageAccountResourceId value. + */ + String storageAccountResourceId(); + + /** + * Gets the azureFileShareName property: Azure file share name. + * + * @return the azureFileShareName value. + */ + String azureFileShareName(); + + /** + * Gets the storageAccountTenantId property: Storage Account Tenant Id. + * + * @return the storageAccountTenantId value. + */ + String storageAccountTenantId(); + + /** + * Gets the partnershipId property: Partnership Id. + * + * @return the partnershipId value. + */ + String partnershipId(); + + /** + * Gets the friendlyName property: Friendly Name. + * + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * Gets the backupEnabled property: Backup Enabled. + * + * @return the backupEnabled value. + */ + String backupEnabled(); + + /** + * Gets the provisioningState property: CloudEndpoint Provisioning State. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the lastWorkflowId property: CloudEndpoint lastWorkflowId. + * + * @return the lastWorkflowId value. + */ + String lastWorkflowId(); + + /** + * Gets the lastOperationName property: Resource Last Operation Name. + * + * @return the lastOperationName value. + */ + String lastOperationName(); + + /** + * Gets the changeEnumerationStatus property: Cloud endpoint change enumeration status. + * + * @return the changeEnumerationStatus value. + */ + CloudEndpointChangeEnumerationStatus changeEnumerationStatus(); + + /** + * Gets the inner com.azure.resourcemanager.storagesync.fluent.models.CloudEndpointInner object. + * + * @return the inner object. + */ + CloudEndpointInner innerModel(); + + /** The entirety of the CloudEndpoint definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The CloudEndpoint definition stages. */ + interface DefinitionStages { + /** The first stage of the CloudEndpoint definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the CloudEndpoint definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, storageSyncServiceName, syncGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @return the next definition stage. + */ + WithCreate withExistingSyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName); + } + /** + * The stage of the CloudEndpoint 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.WithStorageAccountResourceId, + DefinitionStages.WithAzureFileShareName, + DefinitionStages.WithStorageAccountTenantId, + DefinitionStages.WithFriendlyName { + /** + * Executes the create request. + * + * @return the created resource. + */ + CloudEndpoint create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CloudEndpoint create(Context context); + } + /** The stage of the CloudEndpoint definition allowing to specify storageAccountResourceId. */ + interface WithStorageAccountResourceId { + /** + * Specifies the storageAccountResourceId property: Storage Account Resource Id. + * + * @param storageAccountResourceId Storage Account Resource Id. + * @return the next definition stage. + */ + WithCreate withStorageAccountResourceId(String storageAccountResourceId); + } + /** The stage of the CloudEndpoint definition allowing to specify azureFileShareName. */ + interface WithAzureFileShareName { + /** + * Specifies the azureFileShareName property: Azure file share name. + * + * @param azureFileShareName Azure file share name. + * @return the next definition stage. + */ + WithCreate withAzureFileShareName(String azureFileShareName); + } + /** The stage of the CloudEndpoint definition allowing to specify storageAccountTenantId. */ + interface WithStorageAccountTenantId { + /** + * Specifies the storageAccountTenantId property: Storage Account Tenant Id. + * + * @param storageAccountTenantId Storage Account Tenant Id. + * @return the next definition stage. + */ + WithCreate withStorageAccountTenantId(String storageAccountTenantId); + } + /** The stage of the CloudEndpoint definition allowing to specify friendlyName. */ + interface WithFriendlyName { + /** + * Specifies the friendlyName property: Friendly Name. + * + * @param friendlyName Friendly Name. + * @return the next definition stage. + */ + WithCreate withFriendlyName(String friendlyName); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CloudEndpoint refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CloudEndpoint refresh(Context context); + + /** + * Pre Backup a given CloudEndpoint. + * + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void preBackup(BackupRequest parameters); + + /** + * Pre Backup a given CloudEndpoint. + * + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void preBackup(BackupRequest parameters, Context context); + + /** + * Post Backup a given CloudEndpoint. + * + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + PostBackupResponse postBackup(BackupRequest parameters); + + /** + * Post Backup a given CloudEndpoint. + * + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + PostBackupResponse postBackup(BackupRequest parameters, Context context); + + /** + * Pre Restore a given CloudEndpoint. + * + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void preRestore(PreRestoreRequest parameters); + + /** + * Pre Restore a given CloudEndpoint. + * + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void preRestore(PreRestoreRequest parameters, Context context); + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restoreheartbeat(); + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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. + */ + CloudEndpointsRestoreheartbeatResponse restoreheartbeatWithResponse(Context context); + + /** + * Post Restore a given CloudEndpoint. + * + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void postRestore(PostRestoreRequest parameters); + + /** + * Post Restore a given CloudEndpoint. + * + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void postRestore(PostRestoreRequest parameters, Context context); + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param parameters Trigger Change Detection Action parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void triggerChangeDetection(TriggerChangeDetectionParameters parameters); + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param parameters Trigger Change Detection Action parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void triggerChangeDetection(TriggerChangeDetectionParameters parameters, Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointArray.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointArray.java new file mode 100644 index 0000000000000..6249b0b3499b3 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointArray.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.fluent.models.CloudEndpointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Array of CloudEndpoint. */ +@Fluent +public final class CloudEndpointArray { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointArray.class); + + /* + * Collection of CloudEndpoint. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Collection of CloudEndpoint. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of CloudEndpoint. + * + * @param value the value value to set. + * @return the CloudEndpointArray object itself. + */ + public CloudEndpointArray withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationActivity.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationActivity.java new file mode 100644 index 0000000000000..a6f619bc51e90 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationActivity.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Cloud endpoint change enumeration activity object. */ +@Immutable +public final class CloudEndpointChangeEnumerationActivity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointChangeEnumerationActivity.class); + + /* + * Last updated timestamp + */ + @JsonProperty(value = "lastUpdatedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTimestamp; + + /* + * Change enumeration operation state + */ + @JsonProperty(value = "operationState", access = JsonProperty.Access.WRITE_ONLY) + private CloudEndpointChangeEnumerationActivityState operationState; + + /* + * When non-zero, indicates an issue that is delaying change enumeration + */ + @JsonProperty(value = "statusCode", access = JsonProperty.Access.WRITE_ONLY) + private Integer statusCode; + + /* + * Timestamp when change enumeration started + */ + @JsonProperty(value = "startedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedTimestamp; + + /* + * Count of files processed + */ + @JsonProperty(value = "processedFilesCount", access = JsonProperty.Access.WRITE_ONLY) + private Long processedFilesCount; + + /* + * Count of directories processed + */ + @JsonProperty(value = "processedDirectoriesCount", access = JsonProperty.Access.WRITE_ONLY) + private Long processedDirectoriesCount; + + /* + * Total count of files enumerated + */ + @JsonProperty(value = "totalFilesCount", access = JsonProperty.Access.WRITE_ONLY) + private Long totalFilesCount; + + /* + * Total count of directories enumerated + */ + @JsonProperty(value = "totalDirectoriesCount", access = JsonProperty.Access.WRITE_ONLY) + private Long totalDirectoriesCount; + + /* + * Total enumerated size in bytes + */ + @JsonProperty(value = "totalSizeBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long totalSizeBytes; + + /* + * Progress percentage for change enumeration run, excluding processing of + * deletes + */ + @JsonProperty(value = "progressPercent", access = JsonProperty.Access.WRITE_ONLY) + private Integer progressPercent; + + /* + * Estimate of time remaining for the enumeration run + */ + @JsonProperty(value = "minutesRemaining", access = JsonProperty.Access.WRITE_ONLY) + private Integer minutesRemaining; + + /* + * Change enumeration total counts state + */ + @JsonProperty(value = "totalCountsState", access = JsonProperty.Access.WRITE_ONLY) + private CloudEndpointChangeEnumerationTotalCountsState totalCountsState; + + /* + * Progress percentage for processing deletes. This is done separately from + * the rest of the enumeration run + */ + @JsonProperty(value = "deletesProgressPercent", access = JsonProperty.Access.WRITE_ONLY) + private Integer deletesProgressPercent; + + /** + * Get the lastUpdatedTimestamp property: Last updated timestamp. + * + * @return the lastUpdatedTimestamp value. + */ + public OffsetDateTime lastUpdatedTimestamp() { + return this.lastUpdatedTimestamp; + } + + /** + * Get the operationState property: Change enumeration operation state. + * + * @return the operationState value. + */ + public CloudEndpointChangeEnumerationActivityState operationState() { + return this.operationState; + } + + /** + * Get the statusCode property: When non-zero, indicates an issue that is delaying change enumeration. + * + * @return the statusCode value. + */ + public Integer statusCode() { + return this.statusCode; + } + + /** + * Get the startedTimestamp property: Timestamp when change enumeration started. + * + * @return the startedTimestamp value. + */ + public OffsetDateTime startedTimestamp() { + return this.startedTimestamp; + } + + /** + * Get the processedFilesCount property: Count of files processed. + * + * @return the processedFilesCount value. + */ + public Long processedFilesCount() { + return this.processedFilesCount; + } + + /** + * Get the processedDirectoriesCount property: Count of directories processed. + * + * @return the processedDirectoriesCount value. + */ + public Long processedDirectoriesCount() { + return this.processedDirectoriesCount; + } + + /** + * Get the totalFilesCount property: Total count of files enumerated. + * + * @return the totalFilesCount value. + */ + public Long totalFilesCount() { + return this.totalFilesCount; + } + + /** + * Get the totalDirectoriesCount property: Total count of directories enumerated. + * + * @return the totalDirectoriesCount value. + */ + public Long totalDirectoriesCount() { + return this.totalDirectoriesCount; + } + + /** + * Get the totalSizeBytes property: Total enumerated size in bytes. + * + * @return the totalSizeBytes value. + */ + public Long totalSizeBytes() { + return this.totalSizeBytes; + } + + /** + * Get the progressPercent property: Progress percentage for change enumeration run, excluding processing of + * deletes. + * + * @return the progressPercent value. + */ + public Integer progressPercent() { + return this.progressPercent; + } + + /** + * Get the minutesRemaining property: Estimate of time remaining for the enumeration run. + * + * @return the minutesRemaining value. + */ + public Integer minutesRemaining() { + return this.minutesRemaining; + } + + /** + * Get the totalCountsState property: Change enumeration total counts state. + * + * @return the totalCountsState value. + */ + public CloudEndpointChangeEnumerationTotalCountsState totalCountsState() { + return this.totalCountsState; + } + + /** + * Get the deletesProgressPercent property: Progress percentage for processing deletes. This is done separately from + * the rest of the enumeration run. + * + * @return the deletesProgressPercent value. + */ + public Integer deletesProgressPercent() { + return this.deletesProgressPercent; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationActivityState.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationActivityState.java new file mode 100644 index 0000000000000..6dcc415572c60 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationActivityState.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CloudEndpointChangeEnumerationActivityState. */ +public final class CloudEndpointChangeEnumerationActivityState + extends ExpandableStringEnum { + /** Static value InitialEnumerationInProgress for CloudEndpointChangeEnumerationActivityState. */ + public static final CloudEndpointChangeEnumerationActivityState INITIAL_ENUMERATION_IN_PROGRESS = + fromString("InitialEnumerationInProgress"); + + /** Static value EnumerationInProgress for CloudEndpointChangeEnumerationActivityState. */ + public static final CloudEndpointChangeEnumerationActivityState ENUMERATION_IN_PROGRESS = + fromString("EnumerationInProgress"); + + /** + * Creates or finds a CloudEndpointChangeEnumerationActivityState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CloudEndpointChangeEnumerationActivityState. + */ + @JsonCreator + public static CloudEndpointChangeEnumerationActivityState fromString(String name) { + return fromString(name, CloudEndpointChangeEnumerationActivityState.class); + } + + /** @return known CloudEndpointChangeEnumerationActivityState values. */ + public static Collection values() { + return values(CloudEndpointChangeEnumerationActivityState.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationStatus.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationStatus.java new file mode 100644 index 0000000000000..08bd8ce2832f2 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationStatus.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Cloud endpoint change enumeration status object. */ +@Immutable +public final class CloudEndpointChangeEnumerationStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointChangeEnumerationStatus.class); + + /* + * Last updated timestamp + */ + @JsonProperty(value = "lastUpdatedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTimestamp; + + /* + * Status of last completed change enumeration + */ + @JsonProperty(value = "lastEnumerationStatus", access = JsonProperty.Access.WRITE_ONLY) + private CloudEndpointLastChangeEnumerationStatus lastEnumerationStatus; + + /* + * Change enumeration activity + */ + @JsonProperty(value = "activity", access = JsonProperty.Access.WRITE_ONLY) + private CloudEndpointChangeEnumerationActivity activity; + + /** + * Get the lastUpdatedTimestamp property: Last updated timestamp. + * + * @return the lastUpdatedTimestamp value. + */ + public OffsetDateTime lastUpdatedTimestamp() { + return this.lastUpdatedTimestamp; + } + + /** + * Get the lastEnumerationStatus property: Status of last completed change enumeration. + * + * @return the lastEnumerationStatus value. + */ + public CloudEndpointLastChangeEnumerationStatus lastEnumerationStatus() { + return this.lastEnumerationStatus; + } + + /** + * Get the activity property: Change enumeration activity. + * + * @return the activity value. + */ + public CloudEndpointChangeEnumerationActivity activity() { + return this.activity; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (lastEnumerationStatus() != null) { + lastEnumerationStatus().validate(); + } + if (activity() != null) { + activity().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationTotalCountsState.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationTotalCountsState.java new file mode 100644 index 0000000000000..7d67f8ec9fba2 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationTotalCountsState.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for CloudEndpointChangeEnumerationTotalCountsState. */ +public final class CloudEndpointChangeEnumerationTotalCountsState + extends ExpandableStringEnum { + /** Static value Calculating for CloudEndpointChangeEnumerationTotalCountsState. */ + public static final CloudEndpointChangeEnumerationTotalCountsState CALCULATING = fromString("Calculating"); + + /** Static value Final for CloudEndpointChangeEnumerationTotalCountsState. */ + public static final CloudEndpointChangeEnumerationTotalCountsState FINAL = fromString("Final"); + + /** + * Creates or finds a CloudEndpointChangeEnumerationTotalCountsState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CloudEndpointChangeEnumerationTotalCountsState. + */ + @JsonCreator + public static CloudEndpointChangeEnumerationTotalCountsState fromString(String name) { + return fromString(name, CloudEndpointChangeEnumerationTotalCountsState.class); + } + + /** @return known CloudEndpointChangeEnumerationTotalCountsState values. */ + public static Collection values() { + return values(CloudEndpointChangeEnumerationTotalCountsState.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointCreateParameters.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointCreateParameters.java new file mode 100644 index 0000000000000..870c82c52fa58 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointCreateParameters.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used when creating a cloud endpoint. */ +@JsonFlatten +@Fluent +public class CloudEndpointCreateParameters extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointCreateParameters.class); + + /* + * Storage Account Resource Id + */ + @JsonProperty(value = "properties.storageAccountResourceId") + private String storageAccountResourceId; + + /* + * Azure file share name + */ + @JsonProperty(value = "properties.azureFileShareName") + private String azureFileShareName; + + /* + * Storage Account Tenant Id + */ + @JsonProperty(value = "properties.storageAccountTenantId") + private String storageAccountTenantId; + + /* + * Friendly Name + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * Get the storageAccountResourceId property: Storage Account Resource Id. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.storageAccountResourceId; + } + + /** + * Set the storageAccountResourceId property: Storage Account Resource Id. + * + * @param storageAccountResourceId the storageAccountResourceId value to set. + * @return the CloudEndpointCreateParameters object itself. + */ + public CloudEndpointCreateParameters withStorageAccountResourceId(String storageAccountResourceId) { + this.storageAccountResourceId = storageAccountResourceId; + return this; + } + + /** + * Get the azureFileShareName property: Azure file share name. + * + * @return the azureFileShareName value. + */ + public String azureFileShareName() { + return this.azureFileShareName; + } + + /** + * Set the azureFileShareName property: Azure file share name. + * + * @param azureFileShareName the azureFileShareName value to set. + * @return the CloudEndpointCreateParameters object itself. + */ + public CloudEndpointCreateParameters withAzureFileShareName(String azureFileShareName) { + this.azureFileShareName = azureFileShareName; + return this; + } + + /** + * Get the storageAccountTenantId property: Storage Account Tenant Id. + * + * @return the storageAccountTenantId value. + */ + public String storageAccountTenantId() { + return this.storageAccountTenantId; + } + + /** + * Set the storageAccountTenantId property: Storage Account Tenant Id. + * + * @param storageAccountTenantId the storageAccountTenantId value to set. + * @return the CloudEndpointCreateParameters object itself. + */ + public CloudEndpointCreateParameters withStorageAccountTenantId(String storageAccountTenantId) { + this.storageAccountTenantId = storageAccountTenantId; + return this; + } + + /** + * Get the friendlyName property: Friendly Name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly Name. + * + * @param friendlyName the friendlyName value to set. + * @return the CloudEndpointCreateParameters object itself. + */ + public CloudEndpointCreateParameters withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointLastChangeEnumerationStatus.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointLastChangeEnumerationStatus.java new file mode 100644 index 0000000000000..eb6031bfa11b9 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointLastChangeEnumerationStatus.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Cloud endpoint change enumeration status object. */ +@Immutable +public final class CloudEndpointLastChangeEnumerationStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointLastChangeEnumerationStatus.class); + + /* + * Timestamp when change enumeration started + */ + @JsonProperty(value = "startedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedTimestamp; + + /* + * Timestamp when change enumeration completed + */ + @JsonProperty(value = "completedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime completedTimestamp; + + /* + * Count of files in the namespace + */ + @JsonProperty(value = "namespaceFilesCount", access = JsonProperty.Access.WRITE_ONLY) + private Long namespaceFilesCount; + + /* + * Count of directories in the namespace + */ + @JsonProperty(value = "namespaceDirectoriesCount", access = JsonProperty.Access.WRITE_ONLY) + private Long namespaceDirectoriesCount; + + /* + * Namespace size in bytes + */ + @JsonProperty(value = "namespaceSizeBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long namespaceSizeBytes; + + /* + * Timestamp of when change enumeration is expected to run again + */ + @JsonProperty(value = "nextRunTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime nextRunTimestamp; + + /** + * Get the startedTimestamp property: Timestamp when change enumeration started. + * + * @return the startedTimestamp value. + */ + public OffsetDateTime startedTimestamp() { + return this.startedTimestamp; + } + + /** + * Get the completedTimestamp property: Timestamp when change enumeration completed. + * + * @return the completedTimestamp value. + */ + public OffsetDateTime completedTimestamp() { + return this.completedTimestamp; + } + + /** + * Get the namespaceFilesCount property: Count of files in the namespace. + * + * @return the namespaceFilesCount value. + */ + public Long namespaceFilesCount() { + return this.namespaceFilesCount; + } + + /** + * Get the namespaceDirectoriesCount property: Count of directories in the namespace. + * + * @return the namespaceDirectoriesCount value. + */ + public Long namespaceDirectoriesCount() { + return this.namespaceDirectoriesCount; + } + + /** + * Get the namespaceSizeBytes property: Namespace size in bytes. + * + * @return the namespaceSizeBytes value. + */ + public Long namespaceSizeBytes() { + return this.namespaceSizeBytes; + } + + /** + * Get the nextRunTimestamp property: Timestamp of when change enumeration is expected to run again. + * + * @return the nextRunTimestamp value. + */ + public OffsetDateTime nextRunTimestamp() { + return this.nextRunTimestamp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpoints.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpoints.java new file mode 100644 index 0000000000000..4afbf8ea1e828 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpoints.java @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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 CloudEndpoints. */ +public interface CloudEndpoints { + /** + * Get a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given CloudEndpoint. + */ + CloudEndpoint get( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName); + + /** + * Get a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given CloudEndpoint. + */ + Response getWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context); + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, String syncGroupName, String cloudEndpointName); + + /** + * Delete a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context); + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudEndpoint List. + */ + PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName); + + /** + * Get a CloudEndpoint List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a CloudEndpoint List. + */ + PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context); + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void preBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters); + + /** + * Pre Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void preBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context); + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + PostBackupResponse postBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters); + + /** + * Post Backup a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Backup request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return post Backup Response. + */ + PostBackupResponse postBackup( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + BackupRequest parameters, + Context context); + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void preRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters); + + /** + * Pre Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void preRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PreRestoreRequest parameters, + Context context); + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restoreheartbeat( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName); + + /** + * Restore Heartbeat a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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. + */ + CloudEndpointsRestoreheartbeatResponse restoreheartbeatWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context); + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void postRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters); + + /** + * Post Restore a given CloudEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Body of Cloud Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void postRestore( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + PostRestoreRequest parameters, + Context context); + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void triggerChangeDetection( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters); + + /** + * Triggers detection of changes performed on Azure File share connected to the specified Azure File Sync Cloud + * Endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param cloudEndpointName Name of Cloud Endpoint object. + * @param parameters Trigger Change Detection Action parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void triggerChangeDetection( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + TriggerChangeDetectionParameters parameters, + Context context); + + /** + * Get a given CloudEndpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given CloudEndpoint. + */ + CloudEndpoint getById(String id); + + /** + * Get a given CloudEndpoint. + * + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given CloudEndpoint. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a given CloudEndpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 given CloudEndpoint. + * + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 CloudEndpoint resource. + * + * @param name resource name. + * @return the first stage of the new CloudEndpoint definition. + */ + CloudEndpoint.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsCreateHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsCreateHeaders.java new file mode 100644 index 0000000000000..6da01a42862c5 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsCreateHeaders.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudEndpointsCreateHeaders model. */ +@Fluent +public final class CloudEndpointsCreateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointsCreateHeaders.class); + + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the CloudEndpointsCreateHeaders object itself. + */ + public CloudEndpointsCreateHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the CloudEndpointsCreateHeaders object itself. + */ + public CloudEndpointsCreateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the CloudEndpointsCreateHeaders object itself. + */ + public CloudEndpointsCreateHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the CloudEndpointsCreateHeaders object itself. + */ + public CloudEndpointsCreateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the CloudEndpointsCreateHeaders object itself. + */ + public CloudEndpointsCreateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsCreateResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsCreateResponse.java new file mode 100644 index 0000000000000..22c25dbb022be --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsCreateResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.CloudEndpointInner; + +/** Contains all response data for the create operation. */ +public final class CloudEndpointsCreateResponse extends ResponseBase { + /** + * Creates an instance of CloudEndpointsCreateResponse. + * + * @param request the request which resulted in this CloudEndpointsCreateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CloudEndpointsCreateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + CloudEndpointInner value, + CloudEndpointsCreateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public CloudEndpointInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsDeleteHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsDeleteHeaders.java new file mode 100644 index 0000000000000..7e7d2028e56e0 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsDeleteHeaders.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudEndpointsDeleteHeaders model. */ +@Fluent +public final class CloudEndpointsDeleteHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointsDeleteHeaders.class); + + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the CloudEndpointsDeleteHeaders object itself. + */ + public CloudEndpointsDeleteHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the CloudEndpointsDeleteHeaders object itself. + */ + public CloudEndpointsDeleteHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the CloudEndpointsDeleteHeaders object itself. + */ + public CloudEndpointsDeleteHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the CloudEndpointsDeleteHeaders object itself. + */ + public CloudEndpointsDeleteHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the CloudEndpointsDeleteHeaders object itself. + */ + public CloudEndpointsDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsDeleteResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsDeleteResponse.java new file mode 100644 index 0000000000000..1aa12ec322f2b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsDeleteResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the delete operation. */ +public final class CloudEndpointsDeleteResponse extends ResponseBase { + /** + * Creates an instance of CloudEndpointsDeleteResponse. + * + * @param request the request which resulted in this CloudEndpointsDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CloudEndpointsDeleteResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, CloudEndpointsDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsGetHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsGetHeaders.java new file mode 100644 index 0000000000000..6bde7fec7bcfd --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsGetHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudEndpointsGetHeaders model. */ +@Fluent +public final class CloudEndpointsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointsGetHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the CloudEndpointsGetHeaders object itself. + */ + public CloudEndpointsGetHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the CloudEndpointsGetHeaders object itself. + */ + public CloudEndpointsGetHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsGetResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsGetResponse.java new file mode 100644 index 0000000000000..c75a5c9663981 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsGetResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.CloudEndpointInner; + +/** Contains all response data for the get operation. */ +public final class CloudEndpointsGetResponse extends ResponseBase { + /** + * Creates an instance of CloudEndpointsGetResponse. + * + * @param request the request which resulted in this CloudEndpointsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CloudEndpointsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + CloudEndpointInner value, + CloudEndpointsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public CloudEndpointInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsListBySyncGroupHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsListBySyncGroupHeaders.java new file mode 100644 index 0000000000000..7554e2264701d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsListBySyncGroupHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudEndpointsListBySyncGroupHeaders model. */ +@Fluent +public final class CloudEndpointsListBySyncGroupHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointsListBySyncGroupHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the CloudEndpointsListBySyncGroupHeaders object itself. + */ + public CloudEndpointsListBySyncGroupHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the CloudEndpointsListBySyncGroupHeaders object itself. + */ + public CloudEndpointsListBySyncGroupHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsListBySyncGroupResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsListBySyncGroupResponse.java new file mode 100644 index 0000000000000..2ba053422001d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsListBySyncGroupResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the listBySyncGroup operation. */ +public final class CloudEndpointsListBySyncGroupResponse + extends ResponseBase { + /** + * Creates an instance of CloudEndpointsListBySyncGroupResponse. + * + * @param request the request which resulted in this CloudEndpointsListBySyncGroupResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CloudEndpointsListBySyncGroupResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + CloudEndpointArray value, + CloudEndpointsListBySyncGroupHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public CloudEndpointArray getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostBackupHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostBackupHeaders.java new file mode 100644 index 0000000000000..c2c601525abb8 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostBackupHeaders.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudEndpointsPostBackupHeaders model. */ +@Fluent +public final class CloudEndpointsPostBackupHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointsPostBackupHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the CloudEndpointsPostBackupHeaders object itself. + */ + public CloudEndpointsPostBackupHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the CloudEndpointsPostBackupHeaders object itself. + */ + public CloudEndpointsPostBackupHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the CloudEndpointsPostBackupHeaders object itself. + */ + public CloudEndpointsPostBackupHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostBackupResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostBackupResponse.java new file mode 100644 index 0000000000000..7ad928d52112f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostBackupResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.PostBackupResponseInner; + +/** Contains all response data for the postBackup operation. */ +public final class CloudEndpointsPostBackupResponse + extends ResponseBase { + /** + * Creates an instance of CloudEndpointsPostBackupResponse. + * + * @param request the request which resulted in this CloudEndpointsPostBackupResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CloudEndpointsPostBackupResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PostBackupResponseInner value, + CloudEndpointsPostBackupHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PostBackupResponseInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostRestoreHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostRestoreHeaders.java new file mode 100644 index 0000000000000..e17d9ed8b3dc0 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostRestoreHeaders.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudEndpointsPostRestoreHeaders model. */ +@Fluent +public final class CloudEndpointsPostRestoreHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointsPostRestoreHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the CloudEndpointsPostRestoreHeaders object itself. + */ + public CloudEndpointsPostRestoreHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the CloudEndpointsPostRestoreHeaders object itself. + */ + public CloudEndpointsPostRestoreHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the CloudEndpointsPostRestoreHeaders object itself. + */ + public CloudEndpointsPostRestoreHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostRestoreResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostRestoreResponse.java new file mode 100644 index 0000000000000..4b61b219bedcf --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPostRestoreResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the postRestore operation. */ +public final class CloudEndpointsPostRestoreResponse extends ResponseBase { + /** + * Creates an instance of CloudEndpointsPostRestoreResponse. + * + * @param request the request which resulted in this CloudEndpointsPostRestoreResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CloudEndpointsPostRestoreResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + CloudEndpointsPostRestoreHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreBackupHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreBackupHeaders.java new file mode 100644 index 0000000000000..64557ad6a01fb --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreBackupHeaders.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudEndpointsPreBackupHeaders model. */ +@Fluent +public final class CloudEndpointsPreBackupHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointsPreBackupHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the CloudEndpointsPreBackupHeaders object itself. + */ + public CloudEndpointsPreBackupHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the CloudEndpointsPreBackupHeaders object itself. + */ + public CloudEndpointsPreBackupHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the CloudEndpointsPreBackupHeaders object itself. + */ + public CloudEndpointsPreBackupHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreBackupResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreBackupResponse.java new file mode 100644 index 0000000000000..32abbc7ac395d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreBackupResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the preBackup operation. */ +public final class CloudEndpointsPreBackupResponse extends ResponseBase { + /** + * Creates an instance of CloudEndpointsPreBackupResponse. + * + * @param request the request which resulted in this CloudEndpointsPreBackupResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CloudEndpointsPreBackupResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + CloudEndpointsPreBackupHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreRestoreHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreRestoreHeaders.java new file mode 100644 index 0000000000000..7ea6d91cf1430 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreRestoreHeaders.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudEndpointsPreRestoreHeaders model. */ +@Fluent +public final class CloudEndpointsPreRestoreHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointsPreRestoreHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the CloudEndpointsPreRestoreHeaders object itself. + */ + public CloudEndpointsPreRestoreHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the CloudEndpointsPreRestoreHeaders object itself. + */ + public CloudEndpointsPreRestoreHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the CloudEndpointsPreRestoreHeaders object itself. + */ + public CloudEndpointsPreRestoreHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreRestoreResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreRestoreResponse.java new file mode 100644 index 0000000000000..3a0e9d09150f6 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsPreRestoreResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the preRestore operation. */ +public final class CloudEndpointsPreRestoreResponse extends ResponseBase { + /** + * Creates an instance of CloudEndpointsPreRestoreResponse. + * + * @param request the request which resulted in this CloudEndpointsPreRestoreResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CloudEndpointsPreRestoreResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + CloudEndpointsPreRestoreHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsRestoreheartbeatHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsRestoreheartbeatHeaders.java new file mode 100644 index 0000000000000..2bbb07dab4871 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsRestoreheartbeatHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudEndpointsRestoreheartbeatHeaders model. */ +@Fluent +public final class CloudEndpointsRestoreheartbeatHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointsRestoreheartbeatHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the CloudEndpointsRestoreheartbeatHeaders object itself. + */ + public CloudEndpointsRestoreheartbeatHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the CloudEndpointsRestoreheartbeatHeaders object itself. + */ + public CloudEndpointsRestoreheartbeatHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsRestoreheartbeatResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsRestoreheartbeatResponse.java new file mode 100644 index 0000000000000..00c7b3b114ba8 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsRestoreheartbeatResponse.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the restoreheartbeat operation. */ +public final class CloudEndpointsRestoreheartbeatResponse + extends ResponseBase { + /** + * Creates an instance of CloudEndpointsRestoreheartbeatResponse. + * + * @param request the request which resulted in this CloudEndpointsRestoreheartbeatResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CloudEndpointsRestoreheartbeatResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + CloudEndpointsRestoreheartbeatHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsTriggerChangeDetectionHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsTriggerChangeDetectionHeaders.java new file mode 100644 index 0000000000000..a19364a465ce7 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsTriggerChangeDetectionHeaders.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudEndpointsTriggerChangeDetectionHeaders model. */ +@Fluent +public final class CloudEndpointsTriggerChangeDetectionHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudEndpointsTriggerChangeDetectionHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the CloudEndpointsTriggerChangeDetectionHeaders object itself. + */ + public CloudEndpointsTriggerChangeDetectionHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the CloudEndpointsTriggerChangeDetectionHeaders object itself. + */ + public CloudEndpointsTriggerChangeDetectionHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the CloudEndpointsTriggerChangeDetectionHeaders object itself. + */ + public CloudEndpointsTriggerChangeDetectionHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsTriggerChangeDetectionResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsTriggerChangeDetectionResponse.java new file mode 100644 index 0000000000000..0dfcd0e26162d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsTriggerChangeDetectionResponse.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the triggerChangeDetection operation. */ +public final class CloudEndpointsTriggerChangeDetectionResponse + extends ResponseBase { + /** + * Creates an instance of CloudEndpointsTriggerChangeDetectionResponse. + * + * @param request the request which resulted in this CloudEndpointsTriggerChangeDetectionResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public CloudEndpointsTriggerChangeDetectionResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + CloudEndpointsTriggerChangeDetectionHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringCachePerformance.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringCachePerformance.java new file mode 100644 index 0000000000000..4195ca65ba99f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringCachePerformance.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Server endpoint cloud tiering status object. */ +@Immutable +public final class CloudTieringCachePerformance { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudTieringCachePerformance.class); + + /* + * Last updated timestamp + */ + @JsonProperty(value = "lastUpdatedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTimestamp; + + /* + * Count of bytes that were served from the local server + */ + @JsonProperty(value = "cacheHitBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long cacheHitBytes; + + /* + * Count of bytes that were served from the cloud + */ + @JsonProperty(value = "cacheMissBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long cacheMissBytes; + + /* + * Percentage of total bytes (hit + miss) that were served from the local + * server + */ + @JsonProperty(value = "cacheHitBytesPercent", access = JsonProperty.Access.WRITE_ONLY) + private Integer cacheHitBytesPercent; + + /** + * Get the lastUpdatedTimestamp property: Last updated timestamp. + * + * @return the lastUpdatedTimestamp value. + */ + public OffsetDateTime lastUpdatedTimestamp() { + return this.lastUpdatedTimestamp; + } + + /** + * Get the cacheHitBytes property: Count of bytes that were served from the local server. + * + * @return the cacheHitBytes value. + */ + public Long cacheHitBytes() { + return this.cacheHitBytes; + } + + /** + * Get the cacheMissBytes property: Count of bytes that were served from the cloud. + * + * @return the cacheMissBytes value. + */ + public Long cacheMissBytes() { + return this.cacheMissBytes; + } + + /** + * Get the cacheHitBytesPercent property: Percentage of total bytes (hit + miss) that were served from the local + * server. + * + * @return the cacheHitBytesPercent value. + */ + public Integer cacheHitBytesPercent() { + return this.cacheHitBytesPercent; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringDatePolicyStatus.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringDatePolicyStatus.java new file mode 100644 index 0000000000000..d70655740609d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringDatePolicyStatus.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Status of the date policy. */ +@Immutable +public final class CloudTieringDatePolicyStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudTieringDatePolicyStatus.class); + + /* + * Last updated timestamp + */ + @JsonProperty(value = "lastUpdatedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTimestamp; + + /* + * Most recent access time of tiered files + */ + @JsonProperty(value = "tieredFilesMostRecentAccessTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime tieredFilesMostRecentAccessTimestamp; + + /** + * Get the lastUpdatedTimestamp property: Last updated timestamp. + * + * @return the lastUpdatedTimestamp value. + */ + public OffsetDateTime lastUpdatedTimestamp() { + return this.lastUpdatedTimestamp; + } + + /** + * Get the tieredFilesMostRecentAccessTimestamp property: Most recent access time of tiered files. + * + * @return the tieredFilesMostRecentAccessTimestamp value. + */ + public OffsetDateTime tieredFilesMostRecentAccessTimestamp() { + return this.tieredFilesMostRecentAccessTimestamp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringFilesNotTiering.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringFilesNotTiering.java new file mode 100644 index 0000000000000..9cc984263cb30 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringFilesNotTiering.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Server endpoint cloud tiering status object. */ +@Immutable +public final class CloudTieringFilesNotTiering { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudTieringFilesNotTiering.class); + + /* + * Last updated timestamp + */ + @JsonProperty(value = "lastUpdatedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTimestamp; + + /* + * Last cloud tiering result (HResult) + */ + @JsonProperty(value = "totalFileCount", access = JsonProperty.Access.WRITE_ONLY) + private Long totalFileCount; + + /* + * Array of tiering errors + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /** + * Get the lastUpdatedTimestamp property: Last updated timestamp. + * + * @return the lastUpdatedTimestamp value. + */ + public OffsetDateTime lastUpdatedTimestamp() { + return this.lastUpdatedTimestamp; + } + + /** + * Get the totalFileCount property: Last cloud tiering result (HResult). + * + * @return the totalFileCount value. + */ + public Long totalFileCount() { + return this.totalFileCount; + } + + /** + * Get the errors property: Array of tiering errors. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringSpaceSavings.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringSpaceSavings.java new file mode 100644 index 0000000000000..f1d723a2989b9 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringSpaceSavings.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Server endpoint cloud tiering status object. */ +@Immutable +public final class CloudTieringSpaceSavings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudTieringSpaceSavings.class); + + /* + * Last updated timestamp + */ + @JsonProperty(value = "lastUpdatedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTimestamp; + + /* + * Volume size + */ + @JsonProperty(value = "volumeSizeBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long volumeSizeBytes; + + /* + * Total size of content in the azure file share + */ + @JsonProperty(value = "totalSizeCloudBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long totalSizeCloudBytes; + + /* + * Cached content size on the server + */ + @JsonProperty(value = "cachedSizeBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long cachedSizeBytes; + + /* + * Percentage of cached size over total size + */ + @JsonProperty(value = "spaceSavingsPercent", access = JsonProperty.Access.WRITE_ONLY) + private Integer spaceSavingsPercent; + + /* + * Count of bytes saved on the server + */ + @JsonProperty(value = "spaceSavingsBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long spaceSavingsBytes; + + /** + * Get the lastUpdatedTimestamp property: Last updated timestamp. + * + * @return the lastUpdatedTimestamp value. + */ + public OffsetDateTime lastUpdatedTimestamp() { + return this.lastUpdatedTimestamp; + } + + /** + * Get the volumeSizeBytes property: Volume size. + * + * @return the volumeSizeBytes value. + */ + public Long volumeSizeBytes() { + return this.volumeSizeBytes; + } + + /** + * Get the totalSizeCloudBytes property: Total size of content in the azure file share. + * + * @return the totalSizeCloudBytes value. + */ + public Long totalSizeCloudBytes() { + return this.totalSizeCloudBytes; + } + + /** + * Get the cachedSizeBytes property: Cached content size on the server. + * + * @return the cachedSizeBytes value. + */ + public Long cachedSizeBytes() { + return this.cachedSizeBytes; + } + + /** + * Get the spaceSavingsPercent property: Percentage of cached size over total size. + * + * @return the spaceSavingsPercent value. + */ + public Integer spaceSavingsPercent() { + return this.spaceSavingsPercent; + } + + /** + * Get the spaceSavingsBytes property: Count of bytes saved on the server. + * + * @return the spaceSavingsBytes value. + */ + public Long spaceSavingsBytes() { + return this.spaceSavingsBytes; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringVolumeFreeSpacePolicyStatus.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringVolumeFreeSpacePolicyStatus.java new file mode 100644 index 0000000000000..4272af00dfc5d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringVolumeFreeSpacePolicyStatus.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Status of the volume free space policy. */ +@Immutable +public final class CloudTieringVolumeFreeSpacePolicyStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CloudTieringVolumeFreeSpacePolicyStatus.class); + + /* + * Last updated timestamp + */ + @JsonProperty(value = "lastUpdatedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTimestamp; + + /* + * In the case where multiple server endpoints are present in a volume, an + * effective free space policy is applied. + */ + @JsonProperty(value = "effectiveVolumeFreeSpacePolicy", access = JsonProperty.Access.WRITE_ONLY) + private Integer effectiveVolumeFreeSpacePolicy; + + /* + * Current volume free space percentage. + */ + @JsonProperty(value = "currentVolumeFreeSpacePercent", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentVolumeFreeSpacePercent; + + /** + * Get the lastUpdatedTimestamp property: Last updated timestamp. + * + * @return the lastUpdatedTimestamp value. + */ + public OffsetDateTime lastUpdatedTimestamp() { + return this.lastUpdatedTimestamp; + } + + /** + * Get the effectiveVolumeFreeSpacePolicy property: In the case where multiple server endpoints are present in a + * volume, an effective free space policy is applied. + * + * @return the effectiveVolumeFreeSpacePolicy value. + */ + public Integer effectiveVolumeFreeSpacePolicy() { + return this.effectiveVolumeFreeSpacePolicy; + } + + /** + * Get the currentVolumeFreeSpacePercent property: Current volume free space percentage. + * + * @return the currentVolumeFreeSpacePercent value. + */ + public Integer currentVolumeFreeSpacePercent() { + return this.currentVolumeFreeSpacePercent; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/FeatureStatus.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/FeatureStatus.java new file mode 100644 index 0000000000000..a4a86232388c3 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/FeatureStatus.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FeatureStatus. */ +public final class FeatureStatus extends ExpandableStringEnum { + /** Static value on for FeatureStatus. */ + public static final FeatureStatus ON = fromString("on"); + + /** Static value off for FeatureStatus. */ + public static final FeatureStatus OFF = fromString("off"); + + /** + * Creates or finds a FeatureStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding FeatureStatus. + */ + @JsonCreator + public static FeatureStatus fromString(String name) { + return fromString(name, FeatureStatus.class); + } + + /** @return known FeatureStatus values. */ + public static Collection values() { + return values(FeatureStatus.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/FilesNotTieringError.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/FilesNotTieringError.java new file mode 100644 index 0000000000000..f947ec3dee246 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/FilesNotTieringError.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Files not tiering error object. */ +@Immutable +public final class FilesNotTieringError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(FilesNotTieringError.class); + + /* + * Error code (HResult) + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private Integer errorCode; + + /* + * Count of files with this error + */ + @JsonProperty(value = "fileCount", access = JsonProperty.Access.WRITE_ONLY) + private Long fileCount; + + /** + * Get the errorCode property: Error code (HResult). + * + * @return the errorCode value. + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Get the fileCount property: Count of files with this error. + * + * @return the fileCount value. + */ + public Long fileCount() { + return this.fileCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/IncomingTrafficPolicy.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/IncomingTrafficPolicy.java new file mode 100644 index 0000000000000..d02da025ec6a9 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/IncomingTrafficPolicy.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IncomingTrafficPolicy. */ +public final class IncomingTrafficPolicy extends ExpandableStringEnum { + /** Static value AllowAllTraffic for IncomingTrafficPolicy. */ + public static final IncomingTrafficPolicy ALLOW_ALL_TRAFFIC = fromString("AllowAllTraffic"); + + /** Static value AllowVirtualNetworksOnly for IncomingTrafficPolicy. */ + public static final IncomingTrafficPolicy ALLOW_VIRTUAL_NETWORKS_ONLY = fromString("AllowVirtualNetworksOnly"); + + /** + * Creates or finds a IncomingTrafficPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding IncomingTrafficPolicy. + */ + @JsonCreator + public static IncomingTrafficPolicy fromString(String name) { + return fromString(name, IncomingTrafficPolicy.class); + } + + /** @return known IncomingTrafficPolicy values. */ + public static Collection values() { + return values(IncomingTrafficPolicy.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/InitialDownloadPolicy.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/InitialDownloadPolicy.java new file mode 100644 index 0000000000000..29c2a64100c1f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/InitialDownloadPolicy.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for InitialDownloadPolicy. */ +public final class InitialDownloadPolicy extends ExpandableStringEnum { + /** Static value NamespaceOnly for InitialDownloadPolicy. */ + public static final InitialDownloadPolicy NAMESPACE_ONLY = fromString("NamespaceOnly"); + + /** Static value NamespaceThenModifiedFiles for InitialDownloadPolicy. */ + public static final InitialDownloadPolicy NAMESPACE_THEN_MODIFIED_FILES = fromString("NamespaceThenModifiedFiles"); + + /** Static value AvoidTieredFiles for InitialDownloadPolicy. */ + public static final InitialDownloadPolicy AVOID_TIERED_FILES = fromString("AvoidTieredFiles"); + + /** + * Creates or finds a InitialDownloadPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding InitialDownloadPolicy. + */ + @JsonCreator + public static InitialDownloadPolicy fromString(String name) { + return fromString(name, InitialDownloadPolicy.class); + } + + /** @return known InitialDownloadPolicy values. */ + public static Collection values() { + return values(InitialDownloadPolicy.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/InitialUploadPolicy.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/InitialUploadPolicy.java new file mode 100644 index 0000000000000..eb262502dbdf2 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/InitialUploadPolicy.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for InitialUploadPolicy. */ +public final class InitialUploadPolicy extends ExpandableStringEnum { + /** Static value ServerAuthoritative for InitialUploadPolicy. */ + public static final InitialUploadPolicy SERVER_AUTHORITATIVE = fromString("ServerAuthoritative"); + + /** Static value Merge for InitialUploadPolicy. */ + public static final InitialUploadPolicy MERGE = fromString("Merge"); + + /** + * Creates or finds a InitialUploadPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding InitialUploadPolicy. + */ + @JsonCreator + public static InitialUploadPolicy fromString(String name) { + return fromString(name, InitialUploadPolicy.class); + } + + /** @return known InitialUploadPolicy values. */ + public static Collection values() { + return values(InitialUploadPolicy.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/LocalCacheMode.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/LocalCacheMode.java new file mode 100644 index 0000000000000..ffe9be75f3053 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/LocalCacheMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LocalCacheMode. */ +public final class LocalCacheMode extends ExpandableStringEnum { + /** Static value DownloadNewAndModifiedFiles for LocalCacheMode. */ + public static final LocalCacheMode DOWNLOAD_NEW_AND_MODIFIED_FILES = fromString("DownloadNewAndModifiedFiles"); + + /** Static value UpdateLocallyCachedFiles for LocalCacheMode. */ + public static final LocalCacheMode UPDATE_LOCALLY_CACHED_FILES = fromString("UpdateLocallyCachedFiles"); + + /** + * Creates or finds a LocalCacheMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding LocalCacheMode. + */ + @JsonCreator + public static LocalCacheMode fromString(String name) { + return fromString(name, LocalCacheMode.class); + } + + /** @return known LocalCacheMode values. */ + public static Collection values() { + return values(LocalCacheMode.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/NameAvailabilityReason.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/NameAvailabilityReason.java new file mode 100644 index 0000000000000..c8fc3c0ce6e93 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/NameAvailabilityReason.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for NameAvailabilityReason. */ +public enum NameAvailabilityReason { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value AlreadyExists. */ + ALREADY_EXISTS("AlreadyExists"); + + /** The actual serialized value for a NameAvailabilityReason instance. */ + private final String value; + + NameAvailabilityReason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NameAvailabilityReason instance. + * + * @param value the serialized value to parse. + * @return the parsed NameAvailabilityReason object, or null if unable to parse. + */ + @JsonCreator + public static NameAvailabilityReason fromString(String value) { + NameAvailabilityReason[] items = NameAvailabilityReason.values(); + for (NameAvailabilityReason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationDirection.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationDirection.java new file mode 100644 index 0000000000000..fd39e0bdd4fad --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationDirection.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperationDirection. */ +public final class OperationDirection extends ExpandableStringEnum { + /** Static value do for OperationDirection. */ + public static final OperationDirection DO = fromString("do"); + + /** Static value undo for OperationDirection. */ + public static final OperationDirection UNDO = fromString("undo"); + + /** Static value cancel for OperationDirection. */ + public static final OperationDirection CANCEL = fromString("cancel"); + + /** + * Creates or finds a OperationDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationDirection. + */ + @JsonCreator + public static OperationDirection fromString(String name) { + return fromString(name, OperationDirection.class); + } + + /** @return known OperationDirection values. */ + public static Collection values() { + return values(OperationDirection.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationDisplayInfo.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationDisplayInfo.java new file mode 100644 index 0000000000000..3b0d383c13339 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationDisplayInfo.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The operation supported by storage sync. */ +@Fluent +public final class OperationDisplayInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplayInfo.class); + + /* + * The description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The action that users can perform, based on their permission level. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Service provider: Microsoft StorageSync. + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Get the description property: The description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the operation. + * + * @param description the description value to set. + * @return the OperationDisplayInfo object itself. + */ + public OperationDisplayInfo withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the operation property: The action that users can perform, based on their permission level. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The action that users can perform, based on their permission level. + * + * @param operation the operation value to set. + * @return the OperationDisplayInfo object itself. + */ + public OperationDisplayInfo withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the provider property: Service provider: Microsoft StorageSync. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Service provider: Microsoft StorageSync. + * + * @param provider the provider value to set. + * @return the OperationDisplayInfo object itself. + */ + public OperationDisplayInfo withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Resource on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource on which the operation is performed. + * + * @param resource the resource value to set. + * @return the OperationDisplayInfo object itself. + */ + public OperationDisplayInfo withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationEntity.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationEntity.java new file mode 100644 index 0000000000000..3c363b8678c06 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationEntity.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.resourcemanager.storagesync.fluent.models.OperationEntityInner; + +/** An immutable client-side representation of OperationEntity. */ +public interface OperationEntity { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The operation supported by storage sync. + * + * @return the display value. + */ + OperationDisplayInfo display(); + + /** + * Gets the origin property: The origin. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the properties property: Properties of the operations resource. + * + * @return the properties value. + */ + OperationProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.storagesync.fluent.models.OperationEntityInner object. + * + * @return the inner object. + */ + OperationEntityInner innerModel(); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationEntityListResult.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationEntityListResult.java new file mode 100644 index 0000000000000..79f7e54c53f65 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationEntityListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.fluent.models.OperationEntityInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of storage sync operations. */ +@Fluent +public final class OperationEntityListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationEntityListResult.class); + + /* + * The link used to get the next page of operations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * The list of operations. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: The link used to get the next page of operations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of operations. + * + * @param nextLink the nextLink value to set. + * @return the OperationEntityListResult object itself. + */ + public OperationEntityListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: The list of operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of operations. + * + * @param value the value value to set. + * @return the OperationEntityListResult object itself. + */ + public OperationEntityListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationProperties.java new file mode 100644 index 0000000000000..7f0db978c6098 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the operations resource. */ +@Fluent +public final class OperationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationProperties.class); + + /* + * Service specification for the operations resource. + */ + @JsonProperty(value = "serviceSpecification") + private OperationResourceServiceSpecification serviceSpecification; + + /** + * Get the serviceSpecification property: Service specification for the operations resource. + * + * @return the serviceSpecification value. + */ + public OperationResourceServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: Service specification for the operations resource. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(OperationResourceServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationResourceMetricSpecification.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationResourceMetricSpecification.java new file mode 100644 index 0000000000000..636174b9d661d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationResourceMetricSpecification.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Operation Display Resource object. */ +@Fluent +public final class OperationResourceMetricSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResourceMetricSpecification.class); + + /* + * Name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name for the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Display description for the metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Unit for the metric. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * Aggregation type for the metric. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * Fill gaps in the metric with zero. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /* + * Dimensions for the metric specification. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Get the name property: Name of the metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the metric. + * + * @param name the name value to set. + * @return the OperationResourceMetricSpecification object itself. + */ + public OperationResourceMetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name for the metric. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name for the metric. + * + * @param displayName the displayName value to set. + * @return the OperationResourceMetricSpecification object itself. + */ + public OperationResourceMetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: Display description for the metric. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Display description for the metric. + * + * @param displayDescription the displayDescription value to set. + * @return the OperationResourceMetricSpecification object itself. + */ + public OperationResourceMetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: Unit for the metric. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Unit for the metric. + * + * @param unit the unit value to set. + * @return the OperationResourceMetricSpecification object itself. + */ + public OperationResourceMetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the aggregationType property: Aggregation type for the metric. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: Aggregation type for the metric. + * + * @param aggregationType the aggregationType value to set. + * @return the OperationResourceMetricSpecification object itself. + */ + public OperationResourceMetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the fillGapWithZero property: Fill gaps in the metric with zero. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: Fill gaps in the metric with zero. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the OperationResourceMetricSpecification object itself. + */ + public OperationResourceMetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the dimensions property: Dimensions for the metric specification. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Dimensions for the metric specification. + * + * @param dimensions the dimensions value to set. + * @return the OperationResourceMetricSpecification object itself. + */ + public OperationResourceMetricSpecification withDimensions( + List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationResourceMetricSpecificationDimension.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationResourceMetricSpecificationDimension.java new file mode 100644 index 0000000000000..9a6fd6eb195b9 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationResourceMetricSpecificationDimension.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** OperationResourceMetricSpecificationDimension object. */ +@Fluent +public final class OperationResourceMetricSpecificationDimension { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(OperationResourceMetricSpecificationDimension.class); + + /* + * Name of the dimension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Display name of the dimensions. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Indicates metric should be exported for Shoebox. + */ + @JsonProperty(value = "toBeExportedForShoebox") + private Boolean toBeExportedForShoebox; + + /** + * Get the name property: Name of the dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the dimension. + * + * @param name the name value to set. + * @return the OperationResourceMetricSpecificationDimension object itself. + */ + public OperationResourceMetricSpecificationDimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Display name of the dimensions. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of the dimensions. + * + * @param displayName the displayName value to set. + * @return the OperationResourceMetricSpecificationDimension object itself. + */ + public OperationResourceMetricSpecificationDimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the toBeExportedForShoebox property: Indicates metric should be exported for Shoebox. + * + * @return the toBeExportedForShoebox value. + */ + public Boolean toBeExportedForShoebox() { + return this.toBeExportedForShoebox; + } + + /** + * Set the toBeExportedForShoebox property: Indicates metric should be exported for Shoebox. + * + * @param toBeExportedForShoebox the toBeExportedForShoebox value to set. + * @return the OperationResourceMetricSpecificationDimension object itself. + */ + public OperationResourceMetricSpecificationDimension withToBeExportedForShoebox(Boolean toBeExportedForShoebox) { + this.toBeExportedForShoebox = toBeExportedForShoebox; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationResourceServiceSpecification.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationResourceServiceSpecification.java new file mode 100644 index 0000000000000..81458f3aada63 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationResourceServiceSpecification.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service specification. */ +@Fluent +public final class OperationResourceServiceSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResourceServiceSpecification.class); + + /* + * List of metric specifications. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get the metricSpecifications property: List of metric specifications. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: List of metric specifications. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the OperationResourceServiceSpecification object itself. + */ + public OperationResourceServiceSpecification withMetricSpecifications( + List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatus.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatus.java new file mode 100644 index 0000000000000..94177f7cf77a6 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatus.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.resourcemanager.storagesync.fluent.models.OperationStatusInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of OperationStatus. */ +public interface OperationStatus { + /** + * Gets the name property: Operation Id. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the startTime property: Start time of the operation. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: End time of the operation. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the error property: Error details. + * + * @return the error value. + */ + StorageSyncApiError error(); + + /** + * Gets the inner com.azure.resourcemanager.storagesync.fluent.models.OperationStatusInner object. + * + * @return the inner object. + */ + OperationStatusInner innerModel(); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatusOperations.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatusOperations.java new file mode 100644 index 0000000000000..321be04f1af80 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatusOperations.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of OperationStatusOperations. */ +public interface OperationStatusOperations { + /** + * Get Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param locationName The desired region to obtain information from. + * @param workflowId workflow Id. + * @param operationId operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + OperationStatus get(String resourceGroupName, String locationName, String workflowId, String operationId); + + /** + * Get Operation status. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param locationName The desired region to obtain information from. + * @param workflowId workflow Id. + * @param operationId operation Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + Response getWithResponse( + String resourceGroupName, String locationName, String workflowId, String operationId, Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatusOperationsGetHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatusOperationsGetHeaders.java new file mode 100644 index 0000000000000..0a97b08c20310 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatusOperationsGetHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationStatusOperationsGetHeaders model. */ +@Fluent +public final class OperationStatusOperationsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationStatusOperationsGetHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the OperationStatusOperationsGetHeaders object itself. + */ + public OperationStatusOperationsGetHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the OperationStatusOperationsGetHeaders object itself. + */ + public OperationStatusOperationsGetHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatusOperationsGetResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatusOperationsGetResponse.java new file mode 100644 index 0000000000000..e54c80d03a8cf --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatusOperationsGetResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.OperationStatusInner; + +/** Contains all response data for the get operation. */ +public final class OperationStatusOperationsGetResponse + extends ResponseBase { + /** + * Creates an instance of OperationStatusOperationsGetResponse. + * + * @param request the request which resulted in this OperationStatusOperationsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public OperationStatusOperationsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + OperationStatusInner value, + OperationStatusOperationsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public OperationStatusInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Operations.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Operations.java new file mode 100644 index 0000000000000..fbd39001d79b3 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of storage sync operations. + */ + PagedIterable list(); + + /** + * Lists all of the available Storage Sync Rest API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of storage sync operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListHeaders.java new file mode 100644 index 0000000000000..894fae042c1ef --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationsListHeaders model. */ +@Fluent +public final class OperationsListHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsListHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the OperationsListHeaders object itself. + */ + public OperationsListHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the OperationsListHeaders object itself. + */ + public OperationsListHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListNextHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListNextHeaders.java new file mode 100644 index 0000000000000..26fc47625bf15 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListNextHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationsListNextHeaders model. */ +@Fluent +public final class OperationsListNextHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsListNextHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the OperationsListNextHeaders object itself. + */ + public OperationsListNextHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the OperationsListNextHeaders object itself. + */ + public OperationsListNextHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListNextResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListNextResponse.java new file mode 100644 index 0000000000000..2ba49051515ee --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListNextResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the listNext operation. */ +public final class OperationsListNextResponse + extends ResponseBase { + /** + * Creates an instance of OperationsListNextResponse. + * + * @param request the request which resulted in this OperationsListNextResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public OperationsListNextResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + OperationEntityListResult value, + OperationsListNextHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public OperationEntityListResult getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListResponse.java new file mode 100644 index 0000000000000..8218d6a607003 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListResponse.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the list operation. */ +public final class OperationsListResponse extends ResponseBase { + /** + * Creates an instance of OperationsListResponse. + * + * @param request the request which resulted in this OperationsListResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public OperationsListResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + OperationEntityListResult value, + OperationsListHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public OperationEntityListResult getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PostBackupResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PostBackupResponse.java new file mode 100644 index 0000000000000..cc988577dce10 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PostBackupResponse.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.resourcemanager.storagesync.fluent.models.PostBackupResponseInner; + +/** An immutable client-side representation of PostBackupResponse. */ +public interface PostBackupResponse { + /** + * Gets the cloudEndpointName property: cloud endpoint Name. + * + * @return the cloudEndpointName value. + */ + String cloudEndpointName(); + + /** + * Gets the inner com.azure.resourcemanager.storagesync.fluent.models.PostBackupResponseInner object. + * + * @return the inner object. + */ + PostBackupResponseInner innerModel(); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PostRestoreRequest.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PostRestoreRequest.java new file mode 100644 index 0000000000000..e47778c5f7cac --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PostRestoreRequest.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Post Restore Request. */ +@Fluent +public final class PostRestoreRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PostRestoreRequest.class); + + /* + * Post Restore partition. + */ + @JsonProperty(value = "partition") + private String partition; + + /* + * Post Restore replica group. + */ + @JsonProperty(value = "replicaGroup") + private String replicaGroup; + + /* + * Post Restore request id. + */ + @JsonProperty(value = "requestId") + private String requestId; + + /* + * Post Restore Azure file share uri. + */ + @JsonProperty(value = "azureFileShareUri") + private String azureFileShareUri; + + /* + * Post Restore Azure status. + */ + @JsonProperty(value = "status") + private String status; + + /* + * Post Restore Azure source azure file share uri. + */ + @JsonProperty(value = "sourceAzureFileShareUri") + private String sourceAzureFileShareUri; + + /* + * Post Restore Azure failed file list. + */ + @JsonProperty(value = "failedFileList") + private String failedFileList; + + /* + * Post Restore restore file spec array. + */ + @JsonProperty(value = "restoreFileSpec") + private List restoreFileSpec; + + /** + * Get the partition property: Post Restore partition. + * + * @return the partition value. + */ + public String partition() { + return this.partition; + } + + /** + * Set the partition property: Post Restore partition. + * + * @param partition the partition value to set. + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withPartition(String partition) { + this.partition = partition; + return this; + } + + /** + * Get the replicaGroup property: Post Restore replica group. + * + * @return the replicaGroup value. + */ + public String replicaGroup() { + return this.replicaGroup; + } + + /** + * Set the replicaGroup property: Post Restore replica group. + * + * @param replicaGroup the replicaGroup value to set. + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withReplicaGroup(String replicaGroup) { + this.replicaGroup = replicaGroup; + return this; + } + + /** + * Get the requestId property: Post Restore request id. + * + * @return the requestId value. + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId property: Post Restore request id. + * + * @param requestId the requestId value to set. + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get the azureFileShareUri property: Post Restore Azure file share uri. + * + * @return the azureFileShareUri value. + */ + public String azureFileShareUri() { + return this.azureFileShareUri; + } + + /** + * Set the azureFileShareUri property: Post Restore Azure file share uri. + * + * @param azureFileShareUri the azureFileShareUri value to set. + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withAzureFileShareUri(String azureFileShareUri) { + this.azureFileShareUri = azureFileShareUri; + return this; + } + + /** + * Get the status property: Post Restore Azure status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Post Restore Azure status. + * + * @param status the status value to set. + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the sourceAzureFileShareUri property: Post Restore Azure source azure file share uri. + * + * @return the sourceAzureFileShareUri value. + */ + public String sourceAzureFileShareUri() { + return this.sourceAzureFileShareUri; + } + + /** + * Set the sourceAzureFileShareUri property: Post Restore Azure source azure file share uri. + * + * @param sourceAzureFileShareUri the sourceAzureFileShareUri value to set. + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withSourceAzureFileShareUri(String sourceAzureFileShareUri) { + this.sourceAzureFileShareUri = sourceAzureFileShareUri; + return this; + } + + /** + * Get the failedFileList property: Post Restore Azure failed file list. + * + * @return the failedFileList value. + */ + public String failedFileList() { + return this.failedFileList; + } + + /** + * Set the failedFileList property: Post Restore Azure failed file list. + * + * @param failedFileList the failedFileList value to set. + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withFailedFileList(String failedFileList) { + this.failedFileList = failedFileList; + return this; + } + + /** + * Get the restoreFileSpec property: Post Restore restore file spec array. + * + * @return the restoreFileSpec value. + */ + public List restoreFileSpec() { + return this.restoreFileSpec; + } + + /** + * Set the restoreFileSpec property: Post Restore restore file spec array. + * + * @param restoreFileSpec the restoreFileSpec value to set. + * @return the PostRestoreRequest object itself. + */ + public PostRestoreRequest withRestoreFileSpec(List restoreFileSpec) { + this.restoreFileSpec = restoreFileSpec; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (restoreFileSpec() != null) { + restoreFileSpec().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PreRestoreRequest.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PreRestoreRequest.java new file mode 100644 index 0000000000000..84621b105f318 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PreRestoreRequest.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Pre Restore request object. */ +@Fluent +public final class PreRestoreRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PreRestoreRequest.class); + + /* + * Pre Restore partition. + */ + @JsonProperty(value = "partition") + private String partition; + + /* + * Pre Restore replica group. + */ + @JsonProperty(value = "replicaGroup") + private String replicaGroup; + + /* + * Pre Restore request id. + */ + @JsonProperty(value = "requestId") + private String requestId; + + /* + * Pre Restore Azure file share uri. + */ + @JsonProperty(value = "azureFileShareUri") + private String azureFileShareUri; + + /* + * Pre Restore Azure status. + */ + @JsonProperty(value = "status") + private String status; + + /* + * Pre Restore Azure source azure file share uri. + */ + @JsonProperty(value = "sourceAzureFileShareUri") + private String sourceAzureFileShareUri; + + /* + * Pre Restore backup metadata property bag. + */ + @JsonProperty(value = "backupMetadataPropertyBag") + private String backupMetadataPropertyBag; + + /* + * Pre Restore restore file spec array. + */ + @JsonProperty(value = "restoreFileSpec") + private List restoreFileSpec; + + /* + * Pre Restore pause wait for sync drain time period in seconds. + */ + @JsonProperty(value = "pauseWaitForSyncDrainTimePeriodInSeconds") + private Integer pauseWaitForSyncDrainTimePeriodInSeconds; + + /** + * Get the partition property: Pre Restore partition. + * + * @return the partition value. + */ + public String partition() { + return this.partition; + } + + /** + * Set the partition property: Pre Restore partition. + * + * @param partition the partition value to set. + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withPartition(String partition) { + this.partition = partition; + return this; + } + + /** + * Get the replicaGroup property: Pre Restore replica group. + * + * @return the replicaGroup value. + */ + public String replicaGroup() { + return this.replicaGroup; + } + + /** + * Set the replicaGroup property: Pre Restore replica group. + * + * @param replicaGroup the replicaGroup value to set. + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withReplicaGroup(String replicaGroup) { + this.replicaGroup = replicaGroup; + return this; + } + + /** + * Get the requestId property: Pre Restore request id. + * + * @return the requestId value. + */ + public String requestId() { + return this.requestId; + } + + /** + * Set the requestId property: Pre Restore request id. + * + * @param requestId the requestId value to set. + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + /** + * Get the azureFileShareUri property: Pre Restore Azure file share uri. + * + * @return the azureFileShareUri value. + */ + public String azureFileShareUri() { + return this.azureFileShareUri; + } + + /** + * Set the azureFileShareUri property: Pre Restore Azure file share uri. + * + * @param azureFileShareUri the azureFileShareUri value to set. + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withAzureFileShareUri(String azureFileShareUri) { + this.azureFileShareUri = azureFileShareUri; + return this; + } + + /** + * Get the status property: Pre Restore Azure status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Pre Restore Azure status. + * + * @param status the status value to set. + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the sourceAzureFileShareUri property: Pre Restore Azure source azure file share uri. + * + * @return the sourceAzureFileShareUri value. + */ + public String sourceAzureFileShareUri() { + return this.sourceAzureFileShareUri; + } + + /** + * Set the sourceAzureFileShareUri property: Pre Restore Azure source azure file share uri. + * + * @param sourceAzureFileShareUri the sourceAzureFileShareUri value to set. + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withSourceAzureFileShareUri(String sourceAzureFileShareUri) { + this.sourceAzureFileShareUri = sourceAzureFileShareUri; + return this; + } + + /** + * Get the backupMetadataPropertyBag property: Pre Restore backup metadata property bag. + * + * @return the backupMetadataPropertyBag value. + */ + public String backupMetadataPropertyBag() { + return this.backupMetadataPropertyBag; + } + + /** + * Set the backupMetadataPropertyBag property: Pre Restore backup metadata property bag. + * + * @param backupMetadataPropertyBag the backupMetadataPropertyBag value to set. + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withBackupMetadataPropertyBag(String backupMetadataPropertyBag) { + this.backupMetadataPropertyBag = backupMetadataPropertyBag; + return this; + } + + /** + * Get the restoreFileSpec property: Pre Restore restore file spec array. + * + * @return the restoreFileSpec value. + */ + public List restoreFileSpec() { + return this.restoreFileSpec; + } + + /** + * Set the restoreFileSpec property: Pre Restore restore file spec array. + * + * @param restoreFileSpec the restoreFileSpec value to set. + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withRestoreFileSpec(List restoreFileSpec) { + this.restoreFileSpec = restoreFileSpec; + return this; + } + + /** + * Get the pauseWaitForSyncDrainTimePeriodInSeconds property: Pre Restore pause wait for sync drain time period in + * seconds. + * + * @return the pauseWaitForSyncDrainTimePeriodInSeconds value. + */ + public Integer pauseWaitForSyncDrainTimePeriodInSeconds() { + return this.pauseWaitForSyncDrainTimePeriodInSeconds; + } + + /** + * Set the pauseWaitForSyncDrainTimePeriodInSeconds property: Pre Restore pause wait for sync drain time period in + * seconds. + * + * @param pauseWaitForSyncDrainTimePeriodInSeconds the pauseWaitForSyncDrainTimePeriodInSeconds value to set. + * @return the PreRestoreRequest object itself. + */ + public PreRestoreRequest withPauseWaitForSyncDrainTimePeriodInSeconds( + Integer pauseWaitForSyncDrainTimePeriodInSeconds) { + this.pauseWaitForSyncDrainTimePeriodInSeconds = pauseWaitForSyncDrainTimePeriodInSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (restoreFileSpec() != null) { + restoreFileSpec().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpoint.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..b4a5e7cd4a42b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpoint.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint resource. */ +@Immutable +public final class PrivateEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); + + /* + * The ARM identifier for Private Endpoint + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: The ARM identifier for Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnection.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..2a4a801e26337 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnection.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.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 privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.storagesync.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, storageSyncServiceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource + * group. + * @return the next definition stage. + */ + WithCreate withExistingStorageSyncService(String resourceGroupName, String storageSyncServiceName); + } + /** + * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The resource of private end point.. + * + * @param privateEndpoint The resource of private end point. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + /** + * 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/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionListResult.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..a108921d90aa7 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of private endpoint connection associated with the specified storage account. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResult.class); + + /* + * Array of private endpoint connections + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionProvisioningState.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 0000000000000..dab5ea31433f0 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointConnectionProvisioningState. */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** @return known PrivateEndpointConnectionProvisioningState values. */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnections.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..70b008ba13c59 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnections.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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 storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storage sync service. + */ + PrivateEndpointConnection get( + String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName); + + /** + * Gets the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storage sync service. + */ + Response getWithResponse( + String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, String privateEndpointConnectionName, Context context); + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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. + */ + PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName); + + /** + * Get a PrivateEndpointConnection List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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. + */ + PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context); + + /** + * Gets the specified private endpoint connection associated with the storage sync service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storage sync service. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets the specified private endpoint connection associated with the storage sync service. + * + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storage sync service. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified private endpoint connection associated with the storage sync service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storage sync service. + * + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsCreateHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsCreateHeaders.java new file mode 100644 index 0000000000000..878bf77addc31 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsCreateHeaders.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PrivateEndpointConnectionsCreateHeaders model. */ +@Fluent +public final class PrivateEndpointConnectionsCreateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsCreateHeaders.class); + + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the PrivateEndpointConnectionsCreateHeaders object itself. + */ + public PrivateEndpointConnectionsCreateHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the PrivateEndpointConnectionsCreateHeaders object itself. + */ + public PrivateEndpointConnectionsCreateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the PrivateEndpointConnectionsCreateHeaders object itself. + */ + public PrivateEndpointConnectionsCreateHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the PrivateEndpointConnectionsCreateHeaders object itself. + */ + public PrivateEndpointConnectionsCreateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the PrivateEndpointConnectionsCreateHeaders object itself. + */ + public PrivateEndpointConnectionsCreateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsCreateResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsCreateResponse.java new file mode 100644 index 0000000000000..44579bec79faf --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsCreateResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.PrivateEndpointConnectionInner; + +/** Contains all response data for the create operation. */ +public final class PrivateEndpointConnectionsCreateResponse + extends ResponseBase { + /** + * Creates an instance of PrivateEndpointConnectionsCreateResponse. + * + * @param request the request which resulted in this PrivateEndpointConnectionsCreateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PrivateEndpointConnectionsCreateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PrivateEndpointConnectionInner value, + PrivateEndpointConnectionsCreateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PrivateEndpointConnectionInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsDeleteHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsDeleteHeaders.java new file mode 100644 index 0000000000000..4b8b134f14300 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsDeleteHeaders.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PrivateEndpointConnectionsDeleteHeaders model. */ +@Fluent +public final class PrivateEndpointConnectionsDeleteHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsDeleteHeaders.class); + + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the PrivateEndpointConnectionsDeleteHeaders object itself. + */ + public PrivateEndpointConnectionsDeleteHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the PrivateEndpointConnectionsDeleteHeaders object itself. + */ + public PrivateEndpointConnectionsDeleteHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the PrivateEndpointConnectionsDeleteHeaders object itself. + */ + public PrivateEndpointConnectionsDeleteHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the PrivateEndpointConnectionsDeleteHeaders object itself. + */ + public PrivateEndpointConnectionsDeleteHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the PrivateEndpointConnectionsDeleteHeaders object itself. + */ + public PrivateEndpointConnectionsDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsDeleteResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsDeleteResponse.java new file mode 100644 index 0000000000000..7d896421e8719 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsDeleteResponse.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the delete operation. */ +public final class PrivateEndpointConnectionsDeleteResponse + extends ResponseBase { + /** + * Creates an instance of PrivateEndpointConnectionsDeleteResponse. + * + * @param request the request which resulted in this PrivateEndpointConnectionsDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PrivateEndpointConnectionsDeleteResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + PrivateEndpointConnectionsDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsListByStorageSyncServiceHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsListByStorageSyncServiceHeaders.java new file mode 100644 index 0000000000000..a4af83b33f6ee --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsListByStorageSyncServiceHeaders.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PrivateEndpointConnectionsListByStorageSyncServiceHeaders model. */ +@Fluent +public final class PrivateEndpointConnectionsListByStorageSyncServiceHeaders { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(PrivateEndpointConnectionsListByStorageSyncServiceHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the PrivateEndpointConnectionsListByStorageSyncServiceHeaders object itself. + */ + public PrivateEndpointConnectionsListByStorageSyncServiceHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the PrivateEndpointConnectionsListByStorageSyncServiceHeaders object itself. + */ + public PrivateEndpointConnectionsListByStorageSyncServiceHeaders withXMsCorrelationRequestId( + String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsListByStorageSyncServiceResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsListByStorageSyncServiceResponse.java new file mode 100644 index 0000000000000..de0537932d3f0 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsListByStorageSyncServiceResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the listByStorageSyncService operation. */ +public final class PrivateEndpointConnectionsListByStorageSyncServiceResponse + extends ResponseBase< + PrivateEndpointConnectionsListByStorageSyncServiceHeaders, PrivateEndpointConnectionListResult> { + /** + * Creates an instance of PrivateEndpointConnectionsListByStorageSyncServiceResponse. + * + * @param request the request which resulted in this PrivateEndpointConnectionsListByStorageSyncServiceResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PrivateEndpointConnectionsListByStorageSyncServiceResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PrivateEndpointConnectionListResult value, + PrivateEndpointConnectionsListByStorageSyncServiceHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PrivateEndpointConnectionListResult getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointServiceConnectionStatus.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 0000000000000..558129ffe9eb1 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointServiceConnectionStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointServiceConnectionStatus. */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + @JsonCreator + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** @return known PrivateEndpointServiceConnectionStatus values. */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkResource.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..4644d0ec4f97d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkResource.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@JsonFlatten +@Fluent +public class PrivateLinkResource extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResource.class); + + /* + * The private link resource group id. + */ + @JsonProperty(value = "properties.groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "properties.requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResource object itself. + */ + public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkResourceListResult.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..18e1e88e032ca --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkResourceListResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.resourcemanager.storagesync.fluent.models.PrivateLinkResourceListResultInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResourceListResult. */ +public interface PrivateLinkResourceListResult { + /** + * Gets the value property: Array of private link resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.storagesync.fluent.models.PrivateLinkResourceListResultInner object. + * + * @return the inner object. + */ + PrivateLinkResourceListResultInner innerModel(); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkResources.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkResources.java new file mode 100644 index 0000000000000..e573f31b2032c --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkResources.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +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 storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 storage sync service. + */ + PrivateLinkResourceListResult listByStorageSyncService(String resourceGroupName, String storageSyncServiceName); + + /** + * Gets the private link resources that need to be created for a storage sync service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName The name of the storage sync service name within the specified resource group. + * @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 storage sync service. + */ + Response listByStorageSyncServiceWithResponse( + String resourceGroupName, String storageSyncServiceName, Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkServiceConnectionState.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..874eccfbf16a2 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); + + /* + * Indicates whether the connection has been Approved/Rejected/Removed by + * the owner of the service. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any + * updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Reason.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Reason.java new file mode 100644 index 0000000000000..d1419bf5c3dbc --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Reason.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Reason. */ +public final class Reason extends ExpandableStringEnum { + /** Static value Registered for Reason. */ + public static final Reason REGISTERED = fromString("Registered"); + + /** Static value Unregistered for Reason. */ + public static final Reason UNREGISTERED = fromString("Unregistered"); + + /** Static value Warned for Reason. */ + public static final Reason WARNED = fromString("Warned"); + + /** Static value Suspended for Reason. */ + public static final Reason SUSPENDED = fromString("Suspended"); + + /** Static value Deleted for Reason. */ + public static final Reason DELETED = fromString("Deleted"); + + /** + * Creates or finds a Reason from its string representation. + * + * @param name a name to look for. + * @return the corresponding Reason. + */ + @JsonCreator + public static Reason fromString(String name) { + return fromString(name, Reason.class); + } + + /** @return known Reason values. */ + public static Collection values() { + return values(Reason.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RecallActionParameters.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RecallActionParameters.java new file mode 100644 index 0000000000000..5d8837205f672 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RecallActionParameters.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used when calling recall action on server endpoint. */ +@Fluent +public final class RecallActionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecallActionParameters.class); + + /* + * Pattern of the files. + */ + @JsonProperty(value = "pattern") + private String pattern; + + /* + * Recall path. + */ + @JsonProperty(value = "recallPath") + private String recallPath; + + /** + * Get the pattern property: Pattern of the files. + * + * @return the pattern value. + */ + public String pattern() { + return this.pattern; + } + + /** + * Set the pattern property: Pattern of the files. + * + * @param pattern the pattern value to set. + * @return the RecallActionParameters object itself. + */ + public RecallActionParameters withPattern(String pattern) { + this.pattern = pattern; + return this; + } + + /** + * Get the recallPath property: Recall path. + * + * @return the recallPath value. + */ + public String recallPath() { + return this.recallPath; + } + + /** + * Set the recallPath property: Recall path. + * + * @param recallPath the recallPath value to set. + * @return the RecallActionParameters object itself. + */ + public RecallActionParameters withRecallPath(String recallPath) { + this.recallPath = recallPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServer.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServer.java new file mode 100644 index 0000000000000..9d6a4a8a99b7c --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServer.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.fluent.models.RegisteredServerInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of RegisteredServer. */ +public interface RegisteredServer { + /** + * 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 serverCertificate property: Registered Server Certificate. + * + * @return the serverCertificate value. + */ + String serverCertificate(); + + /** + * Gets the agentVersion property: Registered Server Agent Version. + * + * @return the agentVersion value. + */ + String agentVersion(); + + /** + * Gets the agentVersionStatus property: Registered Server Agent Version Status. + * + * @return the agentVersionStatus value. + */ + RegisteredServerAgentVersionStatus agentVersionStatus(); + + /** + * Gets the agentVersionExpirationDate property: Registered Server Agent Version Expiration Date. + * + * @return the agentVersionExpirationDate value. + */ + OffsetDateTime agentVersionExpirationDate(); + + /** + * Gets the serverOSVersion property: Registered Server OS Version. + * + * @return the serverOSVersion value. + */ + String serverOSVersion(); + + /** + * Gets the serverManagementErrorCode property: Registered Server Management Error Code. + * + * @return the serverManagementErrorCode value. + */ + Integer serverManagementErrorCode(); + + /** + * Gets the lastHeartBeat property: Registered Server last heart beat. + * + * @return the lastHeartBeat value. + */ + String lastHeartBeat(); + + /** + * Gets the provisioningState property: Registered Server Provisioning State. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the serverRole property: Registered Server serverRole. + * + * @return the serverRole value. + */ + String serverRole(); + + /** + * Gets the clusterId property: Registered Server clusterId. + * + * @return the clusterId value. + */ + String clusterId(); + + /** + * Gets the clusterName property: Registered Server clusterName. + * + * @return the clusterName value. + */ + String clusterName(); + + /** + * Gets the serverId property: Registered Server serverId. + * + * @return the serverId value. + */ + String serverId(); + + /** + * Gets the storageSyncServiceUid property: Registered Server storageSyncServiceUid. + * + * @return the storageSyncServiceUid value. + */ + String storageSyncServiceUid(); + + /** + * Gets the lastWorkflowId property: Registered Server lastWorkflowId. + * + * @return the lastWorkflowId value. + */ + String lastWorkflowId(); + + /** + * Gets the lastOperationName property: Resource Last Operation Name. + * + * @return the lastOperationName value. + */ + String lastOperationName(); + + /** + * Gets the discoveryEndpointUri property: Resource discoveryEndpointUri. + * + * @return the discoveryEndpointUri value. + */ + String discoveryEndpointUri(); + + /** + * Gets the resourceLocation property: Resource Location. + * + * @return the resourceLocation value. + */ + String resourceLocation(); + + /** + * Gets the serviceLocation property: Service Location. + * + * @return the serviceLocation value. + */ + String serviceLocation(); + + /** + * Gets the friendlyName property: Friendly Name. + * + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * Gets the managementEndpointUri property: Management Endpoint Uri. + * + * @return the managementEndpointUri value. + */ + String managementEndpointUri(); + + /** + * Gets the monitoringEndpointUri property: Telemetry Endpoint Uri. + * + * @return the monitoringEndpointUri value. + */ + String monitoringEndpointUri(); + + /** + * Gets the monitoringConfiguration property: Monitoring Configuration. + * + * @return the monitoringConfiguration value. + */ + String monitoringConfiguration(); + + /** + * Gets the serverName property: Server name. + * + * @return the serverName value. + */ + String serverName(); + + /** + * Gets the inner com.azure.resourcemanager.storagesync.fluent.models.RegisteredServerInner object. + * + * @return the inner object. + */ + RegisteredServerInner innerModel(); + + /** The entirety of the RegisteredServer definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The RegisteredServer definition stages. */ + interface DefinitionStages { + /** The first stage of the RegisteredServer definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the RegisteredServer definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, storageSyncServiceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @return the next definition stage. + */ + WithCreate withExistingStorageSyncService(String resourceGroupName, String storageSyncServiceName); + } + /** + * The stage of the RegisteredServer 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.WithServerCertificate, + DefinitionStages.WithAgentVersion, + DefinitionStages.WithServerOSVersion, + DefinitionStages.WithLastHeartBeat, + DefinitionStages.WithServerRole, + DefinitionStages.WithClusterId, + DefinitionStages.WithClusterName, + DefinitionStages.WithServerId, + DefinitionStages.WithFriendlyName { + /** + * Executes the create request. + * + * @return the created resource. + */ + RegisteredServer create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RegisteredServer create(Context context); + } + /** The stage of the RegisteredServer definition allowing to specify serverCertificate. */ + interface WithServerCertificate { + /** + * Specifies the serverCertificate property: Registered Server Certificate. + * + * @param serverCertificate Registered Server Certificate. + * @return the next definition stage. + */ + WithCreate withServerCertificate(String serverCertificate); + } + /** The stage of the RegisteredServer definition allowing to specify agentVersion. */ + interface WithAgentVersion { + /** + * Specifies the agentVersion property: Registered Server Agent Version. + * + * @param agentVersion Registered Server Agent Version. + * @return the next definition stage. + */ + WithCreate withAgentVersion(String agentVersion); + } + /** The stage of the RegisteredServer definition allowing to specify serverOSVersion. */ + interface WithServerOSVersion { + /** + * Specifies the serverOSVersion property: Registered Server OS Version. + * + * @param serverOSVersion Registered Server OS Version. + * @return the next definition stage. + */ + WithCreate withServerOSVersion(String serverOSVersion); + } + /** The stage of the RegisteredServer definition allowing to specify lastHeartBeat. */ + interface WithLastHeartBeat { + /** + * Specifies the lastHeartBeat property: Registered Server last heart beat. + * + * @param lastHeartBeat Registered Server last heart beat. + * @return the next definition stage. + */ + WithCreate withLastHeartBeat(String lastHeartBeat); + } + /** The stage of the RegisteredServer definition allowing to specify serverRole. */ + interface WithServerRole { + /** + * Specifies the serverRole property: Registered Server serverRole. + * + * @param serverRole Registered Server serverRole. + * @return the next definition stage. + */ + WithCreate withServerRole(String serverRole); + } + /** The stage of the RegisteredServer definition allowing to specify clusterId. */ + interface WithClusterId { + /** + * Specifies the clusterId property: Registered Server clusterId. + * + * @param clusterId Registered Server clusterId. + * @return the next definition stage. + */ + WithCreate withClusterId(String clusterId); + } + /** The stage of the RegisteredServer definition allowing to specify clusterName. */ + interface WithClusterName { + /** + * Specifies the clusterName property: Registered Server clusterName. + * + * @param clusterName Registered Server clusterName. + * @return the next definition stage. + */ + WithCreate withClusterName(String clusterName); + } + /** The stage of the RegisteredServer definition allowing to specify serverId. */ + interface WithServerId { + /** + * Specifies the serverId property: Registered Server serverId. + * + * @param serverId Registered Server serverId. + * @return the next definition stage. + */ + WithCreate withServerId(String serverId); + } + /** The stage of the RegisteredServer definition allowing to specify friendlyName. */ + interface WithFriendlyName { + /** + * Specifies the friendlyName property: Friendly Name. + * + * @param friendlyName Friendly Name. + * @return the next definition stage. + */ + WithCreate withFriendlyName(String friendlyName); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RegisteredServer refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RegisteredServer refresh(Context context); + + /** + * Triggers Server certificate rollover. + * + * @param parameters Body of Trigger Rollover request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void triggerRollover(TriggerRolloverRequest parameters); + + /** + * Triggers Server certificate rollover. + * + * @param parameters Body of Trigger Rollover request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void triggerRollover(TriggerRolloverRequest parameters, Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServerAgentVersionStatus.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServerAgentVersionStatus.java new file mode 100644 index 0000000000000..56721fc829117 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServerAgentVersionStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RegisteredServerAgentVersionStatus. */ +public final class RegisteredServerAgentVersionStatus extends ExpandableStringEnum { + /** Static value Ok for RegisteredServerAgentVersionStatus. */ + public static final RegisteredServerAgentVersionStatus OK = fromString("Ok"); + + /** Static value NearExpiry for RegisteredServerAgentVersionStatus. */ + public static final RegisteredServerAgentVersionStatus NEAR_EXPIRY = fromString("NearExpiry"); + + /** Static value Expired for RegisteredServerAgentVersionStatus. */ + public static final RegisteredServerAgentVersionStatus EXPIRED = fromString("Expired"); + + /** Static value Blocked for RegisteredServerAgentVersionStatus. */ + public static final RegisteredServerAgentVersionStatus BLOCKED = fromString("Blocked"); + + /** + * Creates or finds a RegisteredServerAgentVersionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding RegisteredServerAgentVersionStatus. + */ + @JsonCreator + public static RegisteredServerAgentVersionStatus fromString(String name) { + return fromString(name, RegisteredServerAgentVersionStatus.class); + } + + /** @return known RegisteredServerAgentVersionStatus values. */ + public static Collection values() { + return values(RegisteredServerAgentVersionStatus.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServerArray.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServerArray.java new file mode 100644 index 0000000000000..61c1192ae373e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServerArray.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.fluent.models.RegisteredServerInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Array of RegisteredServer. */ +@Fluent +public final class RegisteredServerArray { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegisteredServerArray.class); + + /* + * Collection of Registered Server. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Collection of Registered Server. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Registered Server. + * + * @param value the value value to set. + * @return the RegisteredServerArray object itself. + */ + public RegisteredServerArray withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServerCreateParameters.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServerCreateParameters.java new file mode 100644 index 0000000000000..cfc4eb18b2fa6 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServerCreateParameters.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used when creating a registered server. */ +@JsonFlatten +@Fluent +public class RegisteredServerCreateParameters extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegisteredServerCreateParameters.class); + + /* + * Registered Server Certificate + */ + @JsonProperty(value = "properties.serverCertificate") + private String serverCertificate; + + /* + * Registered Server Agent Version + */ + @JsonProperty(value = "properties.agentVersion") + private String agentVersion; + + /* + * Registered Server OS Version + */ + @JsonProperty(value = "properties.serverOSVersion") + private String serverOSVersion; + + /* + * Registered Server last heart beat + */ + @JsonProperty(value = "properties.lastHeartBeat") + private String lastHeartBeat; + + /* + * Registered Server serverRole + */ + @JsonProperty(value = "properties.serverRole") + private String serverRole; + + /* + * Registered Server clusterId + */ + @JsonProperty(value = "properties.clusterId") + private String clusterId; + + /* + * Registered Server clusterName + */ + @JsonProperty(value = "properties.clusterName") + private String clusterName; + + /* + * Registered Server serverId + */ + @JsonProperty(value = "properties.serverId") + private String serverId; + + /* + * Friendly Name + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * Get the serverCertificate property: Registered Server Certificate. + * + * @return the serverCertificate value. + */ + public String serverCertificate() { + return this.serverCertificate; + } + + /** + * Set the serverCertificate property: Registered Server Certificate. + * + * @param serverCertificate the serverCertificate value to set. + * @return the RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters withServerCertificate(String serverCertificate) { + this.serverCertificate = serverCertificate; + return this; + } + + /** + * Get the agentVersion property: Registered Server Agent Version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: Registered Server Agent Version. + * + * @param agentVersion the agentVersion value to set. + * @return the RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the serverOSVersion property: Registered Server OS Version. + * + * @return the serverOSVersion value. + */ + public String serverOSVersion() { + return this.serverOSVersion; + } + + /** + * Set the serverOSVersion property: Registered Server OS Version. + * + * @param serverOSVersion the serverOSVersion value to set. + * @return the RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters withServerOSVersion(String serverOSVersion) { + this.serverOSVersion = serverOSVersion; + return this; + } + + /** + * Get the lastHeartBeat property: Registered Server last heart beat. + * + * @return the lastHeartBeat value. + */ + public String lastHeartBeat() { + return this.lastHeartBeat; + } + + /** + * Set the lastHeartBeat property: Registered Server last heart beat. + * + * @param lastHeartBeat the lastHeartBeat value to set. + * @return the RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters withLastHeartBeat(String lastHeartBeat) { + this.lastHeartBeat = lastHeartBeat; + return this; + } + + /** + * Get the serverRole property: Registered Server serverRole. + * + * @return the serverRole value. + */ + public String serverRole() { + return this.serverRole; + } + + /** + * Set the serverRole property: Registered Server serverRole. + * + * @param serverRole the serverRole value to set. + * @return the RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters withServerRole(String serverRole) { + this.serverRole = serverRole; + return this; + } + + /** + * Get the clusterId property: Registered Server clusterId. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Set the clusterId property: Registered Server clusterId. + * + * @param clusterId the clusterId value to set. + * @return the RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters withClusterId(String clusterId) { + this.clusterId = clusterId; + return this; + } + + /** + * Get the clusterName property: Registered Server clusterName. + * + * @return the clusterName value. + */ + public String clusterName() { + return this.clusterName; + } + + /** + * Set the clusterName property: Registered Server clusterName. + * + * @param clusterName the clusterName value to set. + * @return the RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters withClusterName(String clusterName) { + this.clusterName = clusterName; + return this; + } + + /** + * Get the serverId property: Registered Server serverId. + * + * @return the serverId value. + */ + public String serverId() { + return this.serverId; + } + + /** + * Set the serverId property: Registered Server serverId. + * + * @param serverId the serverId value to set. + * @return the RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters withServerId(String serverId) { + this.serverId = serverId; + return this; + } + + /** + * Get the friendlyName property: Friendly Name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly Name. + * + * @param friendlyName the friendlyName value to set. + * @return the RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServers.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServers.java new file mode 100644 index 0000000000000..8ec801ca26fef --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServers.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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 RegisteredServers. */ +public interface RegisteredServers { + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server list. + */ + PagedIterable listByStorageSyncService(String resourceGroupName, String storageSyncServiceName); + + /** + * Get a given registered server list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server list. + */ + PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context); + + /** + * Get a given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server. + */ + RegisteredServer get(String resourceGroupName, String storageSyncServiceName, String serverId); + + /** + * Get a given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server. + */ + Response getWithResponse( + String resourceGroupName, String storageSyncServiceName, String serverId, Context context); + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, String serverId); + + /** + * Delete the given registered server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId GUID identifying the on-premises server. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, String serverId, Context context); + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void triggerRollover( + String resourceGroupName, String storageSyncServiceName, String serverId, TriggerRolloverRequest parameters); + + /** + * Triggers Server certificate rollover. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param serverId Server Id. + * @param parameters Body of Trigger Rollover request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void triggerRollover( + String resourceGroupName, + String storageSyncServiceName, + String serverId, + TriggerRolloverRequest parameters, + Context context); + + /** + * Get a given registered server. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server. + */ + RegisteredServer getById(String id); + + /** + * Get a given registered server. + * + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given registered server. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the given registered server. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 the given registered server. + * + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 RegisteredServer resource. + * + * @param name resource name. + * @return the first stage of the new RegisteredServer definition. + */ + RegisteredServer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersCreateHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersCreateHeaders.java new file mode 100644 index 0000000000000..073a2fd7388c7 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersCreateHeaders.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The RegisteredServersCreateHeaders model. */ +@Fluent +public final class RegisteredServersCreateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegisteredServersCreateHeaders.class); + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the RegisteredServersCreateHeaders object itself. + */ + public RegisteredServersCreateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the RegisteredServersCreateHeaders object itself. + */ + public RegisteredServersCreateHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the RegisteredServersCreateHeaders object itself. + */ + public RegisteredServersCreateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the RegisteredServersCreateHeaders object itself. + */ + public RegisteredServersCreateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersCreateResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersCreateResponse.java new file mode 100644 index 0000000000000..34e551b3eb8ec --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersCreateResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.RegisteredServerInner; + +/** Contains all response data for the create operation. */ +public final class RegisteredServersCreateResponse + extends ResponseBase { + /** + * Creates an instance of RegisteredServersCreateResponse. + * + * @param request the request which resulted in this RegisteredServersCreateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public RegisteredServersCreateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + RegisteredServerInner value, + RegisteredServersCreateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public RegisteredServerInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersDeleteHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersDeleteHeaders.java new file mode 100644 index 0000000000000..98f9a0e7a3783 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersDeleteHeaders.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The RegisteredServersDeleteHeaders model. */ +@Fluent +public final class RegisteredServersDeleteHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegisteredServersDeleteHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the RegisteredServersDeleteHeaders object itself. + */ + public RegisteredServersDeleteHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the RegisteredServersDeleteHeaders object itself. + */ + public RegisteredServersDeleteHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the RegisteredServersDeleteHeaders object itself. + */ + public RegisteredServersDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersDeleteResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersDeleteResponse.java new file mode 100644 index 0000000000000..53b9ddff66491 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersDeleteResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the delete operation. */ +public final class RegisteredServersDeleteResponse extends ResponseBase { + /** + * Creates an instance of RegisteredServersDeleteResponse. + * + * @param request the request which resulted in this RegisteredServersDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public RegisteredServersDeleteResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + RegisteredServersDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersGetHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersGetHeaders.java new file mode 100644 index 0000000000000..fae08f004f47e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersGetHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The RegisteredServersGetHeaders model. */ +@Fluent +public final class RegisteredServersGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegisteredServersGetHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the RegisteredServersGetHeaders object itself. + */ + public RegisteredServersGetHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the RegisteredServersGetHeaders object itself. + */ + public RegisteredServersGetHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersGetResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersGetResponse.java new file mode 100644 index 0000000000000..3a4430fbf1f05 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersGetResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.RegisteredServerInner; + +/** Contains all response data for the get operation. */ +public final class RegisteredServersGetResponse + extends ResponseBase { + /** + * Creates an instance of RegisteredServersGetResponse. + * + * @param request the request which resulted in this RegisteredServersGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public RegisteredServersGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + RegisteredServerInner value, + RegisteredServersGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public RegisteredServerInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersListByStorageSyncServiceHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersListByStorageSyncServiceHeaders.java new file mode 100644 index 0000000000000..182251cc84cd4 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersListByStorageSyncServiceHeaders.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The RegisteredServersListByStorageSyncServiceHeaders model. */ +@Fluent +public final class RegisteredServersListByStorageSyncServiceHeaders { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(RegisteredServersListByStorageSyncServiceHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the RegisteredServersListByStorageSyncServiceHeaders object itself. + */ + public RegisteredServersListByStorageSyncServiceHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the RegisteredServersListByStorageSyncServiceHeaders object itself. + */ + public RegisteredServersListByStorageSyncServiceHeaders withXMsCorrelationRequestId( + String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersListByStorageSyncServiceResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersListByStorageSyncServiceResponse.java new file mode 100644 index 0000000000000..6225b87339ce2 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersListByStorageSyncServiceResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the listByStorageSyncService operation. */ +public final class RegisteredServersListByStorageSyncServiceResponse + extends ResponseBase { + /** + * Creates an instance of RegisteredServersListByStorageSyncServiceResponse. + * + * @param request the request which resulted in this RegisteredServersListByStorageSyncServiceResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public RegisteredServersListByStorageSyncServiceResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + RegisteredServerArray value, + RegisteredServersListByStorageSyncServiceHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public RegisteredServerArray getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersTriggerRolloverHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersTriggerRolloverHeaders.java new file mode 100644 index 0000000000000..a01ad052c9c46 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersTriggerRolloverHeaders.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The RegisteredServersTriggerRolloverHeaders model. */ +@Fluent +public final class RegisteredServersTriggerRolloverHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegisteredServersTriggerRolloverHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the RegisteredServersTriggerRolloverHeaders object itself. + */ + public RegisteredServersTriggerRolloverHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the RegisteredServersTriggerRolloverHeaders object itself. + */ + public RegisteredServersTriggerRolloverHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the RegisteredServersTriggerRolloverHeaders object itself. + */ + public RegisteredServersTriggerRolloverHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersTriggerRolloverResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersTriggerRolloverResponse.java new file mode 100644 index 0000000000000..77f195d2a390e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersTriggerRolloverResponse.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the triggerRollover operation. */ +public final class RegisteredServersTriggerRolloverResponse + extends ResponseBase { + /** + * Creates an instance of RegisteredServersTriggerRolloverResponse. + * + * @param request the request which resulted in this RegisteredServersTriggerRolloverResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public RegisteredServersTriggerRolloverResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + RegisteredServersTriggerRolloverHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RestoreFileSpec.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RestoreFileSpec.java new file mode 100644 index 0000000000000..ead119eb14b44 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RestoreFileSpec.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Restore file spec. */ +@Fluent +public final class RestoreFileSpec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestoreFileSpec.class); + + /* + * Restore file spec path + */ + @JsonProperty(value = "path") + private String path; + + /* + * Restore file spec isdir + */ + @JsonProperty(value = "isdir") + private Boolean isdir; + + /** + * Get the path property: Restore file spec path. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Restore file spec path. + * + * @param path the path value to set. + * @return the RestoreFileSpec object itself. + */ + public RestoreFileSpec withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the isdir property: Restore file spec isdir. + * + * @return the isdir value. + */ + public Boolean isdir() { + return this.isdir; + } + + /** + * Set the isdir property: Restore file spec isdir. + * + * @param isdir the isdir value to set. + * @return the RestoreFileSpec object itself. + */ + public RestoreFileSpec withIsdir(Boolean isdir) { + this.isdir = isdir; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpoint.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpoint.java new file mode 100644 index 0000000000000..4e93c1e8ac28b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpoint.java @@ -0,0 +1,482 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.fluent.models.ServerEndpointInner; + +/** An immutable client-side representation of ServerEndpoint. */ +public interface ServerEndpoint { + /** + * 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 serverLocalPath property: Server Local path. + * + * @return the serverLocalPath value. + */ + String serverLocalPath(); + + /** + * Gets the cloudTiering property: Cloud Tiering. + * + * @return the cloudTiering value. + */ + FeatureStatus cloudTiering(); + + /** + * Gets the volumeFreeSpacePercent property: Level of free space to be maintained by Cloud Tiering if it is enabled. + * + * @return the volumeFreeSpacePercent value. + */ + Integer volumeFreeSpacePercent(); + + /** + * Gets the tierFilesOlderThanDays property: Tier files older than days. + * + * @return the tierFilesOlderThanDays value. + */ + Integer tierFilesOlderThanDays(); + + /** + * Gets the friendlyName property: Friendly Name. + * + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * Gets the serverResourceId property: Server Resource Id. + * + * @return the serverResourceId value. + */ + String serverResourceId(); + + /** + * Gets the provisioningState property: ServerEndpoint Provisioning State. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the lastWorkflowId property: ServerEndpoint lastWorkflowId. + * + * @return the lastWorkflowId value. + */ + String lastWorkflowId(); + + /** + * Gets the lastOperationName property: Resource Last Operation Name. + * + * @return the lastOperationName value. + */ + String lastOperationName(); + + /** + * Gets the syncStatus property: Server Endpoint sync status. + * + * @return the syncStatus value. + */ + ServerEndpointSyncStatus syncStatus(); + + /** + * Gets the offlineDataTransfer property: Offline data transfer. + * + * @return the offlineDataTransfer value. + */ + FeatureStatus offlineDataTransfer(); + + /** + * Gets the offlineDataTransferStorageAccountResourceId property: Offline data transfer storage account resource ID. + * + * @return the offlineDataTransferStorageAccountResourceId value. + */ + String offlineDataTransferStorageAccountResourceId(); + + /** + * Gets the offlineDataTransferStorageAccountTenantId property: Offline data transfer storage account tenant ID. + * + * @return the offlineDataTransferStorageAccountTenantId value. + */ + String offlineDataTransferStorageAccountTenantId(); + + /** + * Gets the offlineDataTransferShareName property: Offline data transfer share name. + * + * @return the offlineDataTransferShareName value. + */ + String offlineDataTransferShareName(); + + /** + * Gets the cloudTieringStatus property: Cloud tiering status. Only populated if cloud tiering is enabled. + * + * @return the cloudTieringStatus value. + */ + ServerEndpointCloudTieringStatus cloudTieringStatus(); + + /** + * Gets the recallStatus property: Recall status. Only populated if cloud tiering is enabled. + * + * @return the recallStatus value. + */ + ServerEndpointRecallStatus recallStatus(); + + /** + * Gets the initialDownloadPolicy property: Policy for how namespace and files are recalled during FastDr. + * + * @return the initialDownloadPolicy value. + */ + InitialDownloadPolicy initialDownloadPolicy(); + + /** + * Gets the localCacheMode property: Policy for enabling follow-the-sun business models: link local cache to cloud + * behavior to pre-populate before local access. + * + * @return the localCacheMode value. + */ + LocalCacheMode localCacheMode(); + + /** + * Gets the initialUploadPolicy property: Policy for how the initial upload sync session is performed. + * + * @return the initialUploadPolicy value. + */ + InitialUploadPolicy initialUploadPolicy(); + + /** + * Gets the serverName property: Server name. + * + * @return the serverName value. + */ + String serverName(); + + /** + * Gets the inner com.azure.resourcemanager.storagesync.fluent.models.ServerEndpointInner object. + * + * @return the inner object. + */ + ServerEndpointInner innerModel(); + + /** The entirety of the ServerEndpoint definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ServerEndpoint definition stages. */ + interface DefinitionStages { + /** The first stage of the ServerEndpoint definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ServerEndpoint definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, storageSyncServiceName, syncGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @return the next definition stage. + */ + WithCreate withExistingSyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName); + } + /** + * The stage of the ServerEndpoint 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.WithServerLocalPath, + DefinitionStages.WithCloudTiering, + DefinitionStages.WithVolumeFreeSpacePercent, + DefinitionStages.WithTierFilesOlderThanDays, + DefinitionStages.WithFriendlyName, + DefinitionStages.WithServerResourceId, + DefinitionStages.WithOfflineDataTransfer, + DefinitionStages.WithOfflineDataTransferShareName, + DefinitionStages.WithInitialDownloadPolicy, + DefinitionStages.WithLocalCacheMode, + DefinitionStages.WithInitialUploadPolicy { + /** + * Executes the create request. + * + * @return the created resource. + */ + ServerEndpoint create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ServerEndpoint create(Context context); + } + /** The stage of the ServerEndpoint definition allowing to specify serverLocalPath. */ + interface WithServerLocalPath { + /** + * Specifies the serverLocalPath property: Server Local path.. + * + * @param serverLocalPath Server Local path. + * @return the next definition stage. + */ + WithCreate withServerLocalPath(String serverLocalPath); + } + /** The stage of the ServerEndpoint definition allowing to specify cloudTiering. */ + interface WithCloudTiering { + /** + * Specifies the cloudTiering property: Cloud Tiering.. + * + * @param cloudTiering Cloud Tiering. + * @return the next definition stage. + */ + WithCreate withCloudTiering(FeatureStatus cloudTiering); + } + /** The stage of the ServerEndpoint definition allowing to specify volumeFreeSpacePercent. */ + interface WithVolumeFreeSpacePercent { + /** + * Specifies the volumeFreeSpacePercent property: Level of free space to be maintained by Cloud Tiering if + * it is enabled.. + * + * @param volumeFreeSpacePercent Level of free space to be maintained by Cloud Tiering if it is enabled. + * @return the next definition stage. + */ + WithCreate withVolumeFreeSpacePercent(Integer volumeFreeSpacePercent); + } + /** The stage of the ServerEndpoint definition allowing to specify tierFilesOlderThanDays. */ + interface WithTierFilesOlderThanDays { + /** + * Specifies the tierFilesOlderThanDays property: Tier files older than days.. + * + * @param tierFilesOlderThanDays Tier files older than days. + * @return the next definition stage. + */ + WithCreate withTierFilesOlderThanDays(Integer tierFilesOlderThanDays); + } + /** The stage of the ServerEndpoint definition allowing to specify friendlyName. */ + interface WithFriendlyName { + /** + * Specifies the friendlyName property: Friendly Name. + * + * @param friendlyName Friendly Name. + * @return the next definition stage. + */ + WithCreate withFriendlyName(String friendlyName); + } + /** The stage of the ServerEndpoint definition allowing to specify serverResourceId. */ + interface WithServerResourceId { + /** + * Specifies the serverResourceId property: Server Resource Id.. + * + * @param serverResourceId Server Resource Id. + * @return the next definition stage. + */ + WithCreate withServerResourceId(String serverResourceId); + } + /** The stage of the ServerEndpoint definition allowing to specify offlineDataTransfer. */ + interface WithOfflineDataTransfer { + /** + * Specifies the offlineDataTransfer property: Offline data transfer. + * + * @param offlineDataTransfer Offline data transfer. + * @return the next definition stage. + */ + WithCreate withOfflineDataTransfer(FeatureStatus offlineDataTransfer); + } + /** The stage of the ServerEndpoint definition allowing to specify offlineDataTransferShareName. */ + interface WithOfflineDataTransferShareName { + /** + * Specifies the offlineDataTransferShareName property: Offline data transfer share name. + * + * @param offlineDataTransferShareName Offline data transfer share name. + * @return the next definition stage. + */ + WithCreate withOfflineDataTransferShareName(String offlineDataTransferShareName); + } + /** The stage of the ServerEndpoint definition allowing to specify initialDownloadPolicy. */ + interface WithInitialDownloadPolicy { + /** + * Specifies the initialDownloadPolicy property: Policy for how namespace and files are recalled during + * FastDr.. + * + * @param initialDownloadPolicy Policy for how namespace and files are recalled during FastDr. + * @return the next definition stage. + */ + WithCreate withInitialDownloadPolicy(InitialDownloadPolicy initialDownloadPolicy); + } + /** The stage of the ServerEndpoint definition allowing to specify localCacheMode. */ + interface WithLocalCacheMode { + /** + * Specifies the localCacheMode property: Policy for enabling follow-the-sun business models: link local + * cache to cloud behavior to pre-populate before local access.. + * + * @param localCacheMode Policy for enabling follow-the-sun business models: link local cache to cloud + * behavior to pre-populate before local access. + * @return the next definition stage. + */ + WithCreate withLocalCacheMode(LocalCacheMode localCacheMode); + } + /** The stage of the ServerEndpoint definition allowing to specify initialUploadPolicy. */ + interface WithInitialUploadPolicy { + /** + * Specifies the initialUploadPolicy property: Policy for how the initial upload sync session is performed.. + * + * @param initialUploadPolicy Policy for how the initial upload sync session is performed. + * @return the next definition stage. + */ + WithCreate withInitialUploadPolicy(InitialUploadPolicy initialUploadPolicy); + } + } + /** + * Begins update for the ServerEndpoint resource. + * + * @return the stage of resource update. + */ + ServerEndpoint.Update update(); + + /** The template for ServerEndpoint update. */ + interface Update + extends UpdateStages.WithCloudTiering, + UpdateStages.WithVolumeFreeSpacePercent, + UpdateStages.WithTierFilesOlderThanDays, + UpdateStages.WithOfflineDataTransfer, + UpdateStages.WithOfflineDataTransferShareName, + UpdateStages.WithLocalCacheMode { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ServerEndpoint apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ServerEndpoint apply(Context context); + } + /** The ServerEndpoint update stages. */ + interface UpdateStages { + /** The stage of the ServerEndpoint update allowing to specify cloudTiering. */ + interface WithCloudTiering { + /** + * Specifies the cloudTiering property: Cloud Tiering.. + * + * @param cloudTiering Cloud Tiering. + * @return the next definition stage. + */ + Update withCloudTiering(FeatureStatus cloudTiering); + } + /** The stage of the ServerEndpoint update allowing to specify volumeFreeSpacePercent. */ + interface WithVolumeFreeSpacePercent { + /** + * Specifies the volumeFreeSpacePercent property: Level of free space to be maintained by Cloud Tiering if + * it is enabled.. + * + * @param volumeFreeSpacePercent Level of free space to be maintained by Cloud Tiering if it is enabled. + * @return the next definition stage. + */ + Update withVolumeFreeSpacePercent(Integer volumeFreeSpacePercent); + } + /** The stage of the ServerEndpoint update allowing to specify tierFilesOlderThanDays. */ + interface WithTierFilesOlderThanDays { + /** + * Specifies the tierFilesOlderThanDays property: Tier files older than days.. + * + * @param tierFilesOlderThanDays Tier files older than days. + * @return the next definition stage. + */ + Update withTierFilesOlderThanDays(Integer tierFilesOlderThanDays); + } + /** The stage of the ServerEndpoint update allowing to specify offlineDataTransfer. */ + interface WithOfflineDataTransfer { + /** + * Specifies the offlineDataTransfer property: Offline data transfer. + * + * @param offlineDataTransfer Offline data transfer. + * @return the next definition stage. + */ + Update withOfflineDataTransfer(FeatureStatus offlineDataTransfer); + } + /** The stage of the ServerEndpoint update allowing to specify offlineDataTransferShareName. */ + interface WithOfflineDataTransferShareName { + /** + * Specifies the offlineDataTransferShareName property: Offline data transfer share name. + * + * @param offlineDataTransferShareName Offline data transfer share name. + * @return the next definition stage. + */ + Update withOfflineDataTransferShareName(String offlineDataTransferShareName); + } + /** The stage of the ServerEndpoint update allowing to specify localCacheMode. */ + interface WithLocalCacheMode { + /** + * Specifies the localCacheMode property: Policy for enabling follow-the-sun business models: link local + * cache to cloud behavior to pre-populate before local access.. + * + * @param localCacheMode Policy for enabling follow-the-sun business models: link local cache to cloud + * behavior to pre-populate before local access. + * @return the next definition stage. + */ + Update withLocalCacheMode(LocalCacheMode localCacheMode); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ServerEndpoint refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ServerEndpoint refresh(Context context); + + /** + * Recall a server endpoint. + * + * @param parameters Body of Recall Action object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void recallAction(RecallActionParameters parameters); + + /** + * Recall a server endpoint. + * + * @param parameters Body of Recall Action object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void recallAction(RecallActionParameters parameters, Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointArray.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointArray.java new file mode 100644 index 0000000000000..de85f1d3ffa0b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointArray.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.fluent.models.ServerEndpointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Array of ServerEndpoint. */ +@Fluent +public final class ServerEndpointArray { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointArray.class); + + /* + * Collection of ServerEndpoint. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Collection of ServerEndpoint. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of ServerEndpoint. + * + * @param value the value value to set. + * @return the ServerEndpointArray object itself. + */ + public ServerEndpointArray withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointBackgroundDataDownloadActivity.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointBackgroundDataDownloadActivity.java new file mode 100644 index 0000000000000..3be833f7f3db1 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointBackgroundDataDownloadActivity.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Background data download activity object. */ +@Immutable +public final class ServerEndpointBackgroundDataDownloadActivity { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ServerEndpointBackgroundDataDownloadActivity.class); + + /* + * Timestamp when properties were updated + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /* + * Timestamp when the operation started + */ + @JsonProperty(value = "startedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedTimestamp; + + /* + * Progress percentage + */ + @JsonProperty(value = "percentProgress", access = JsonProperty.Access.WRITE_ONLY) + private Integer percentProgress; + + /* + * Running count of bytes downloaded + */ + @JsonProperty(value = "downloadedBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long downloadedBytes; + + /** + * Get the timestamp property: Timestamp when properties were updated. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the startedTimestamp property: Timestamp when the operation started. + * + * @return the startedTimestamp value. + */ + public OffsetDateTime startedTimestamp() { + return this.startedTimestamp; + } + + /** + * Get the percentProgress property: Progress percentage. + * + * @return the percentProgress value. + */ + public Integer percentProgress() { + return this.percentProgress; + } + + /** + * Get the downloadedBytes property: Running count of bytes downloaded. + * + * @return the downloadedBytes value. + */ + public Long downloadedBytes() { + return this.downloadedBytes; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointCloudTieringStatus.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointCloudTieringStatus.java new file mode 100644 index 0000000000000..55a4bd116b822 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointCloudTieringStatus.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Server endpoint cloud tiering status object. */ +@Immutable +public final class ServerEndpointCloudTieringStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointCloudTieringStatus.class); + + /* + * Last updated timestamp + */ + @JsonProperty(value = "lastUpdatedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTimestamp; + + /* + * Cloud tiering health state. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointHealthState health; + + /* + * The last updated timestamp of health state + */ + @JsonProperty(value = "healthLastUpdatedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime healthLastUpdatedTimestamp; + + /* + * Last cloud tiering result (HResult) + */ + @JsonProperty(value = "lastCloudTieringResult", access = JsonProperty.Access.WRITE_ONLY) + private Integer lastCloudTieringResult; + + /* + * Last cloud tiering success timestamp + */ + @JsonProperty(value = "lastSuccessTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastSuccessTimestamp; + + /* + * Information regarding how much local space cloud tiering is saving. + */ + @JsonProperty(value = "spaceSavings", access = JsonProperty.Access.WRITE_ONLY) + private CloudTieringSpaceSavings spaceSavings; + + /* + * Information regarding how well the local cache on the server is + * performing. + */ + @JsonProperty(value = "cachePerformance", access = JsonProperty.Access.WRITE_ONLY) + private CloudTieringCachePerformance cachePerformance; + + /* + * Information regarding files that failed to be tiered + */ + @JsonProperty(value = "filesNotTiering", access = JsonProperty.Access.WRITE_ONLY) + private CloudTieringFilesNotTiering filesNotTiering; + + /* + * Status of the volume free space policy + */ + @JsonProperty(value = "volumeFreeSpacePolicyStatus", access = JsonProperty.Access.WRITE_ONLY) + private CloudTieringVolumeFreeSpacePolicyStatus volumeFreeSpacePolicyStatus; + + /* + * Status of the date policy + */ + @JsonProperty(value = "datePolicyStatus", access = JsonProperty.Access.WRITE_ONLY) + private CloudTieringDatePolicyStatus datePolicyStatus; + + /** + * Get the lastUpdatedTimestamp property: Last updated timestamp. + * + * @return the lastUpdatedTimestamp value. + */ + public OffsetDateTime lastUpdatedTimestamp() { + return this.lastUpdatedTimestamp; + } + + /** + * Get the health property: Cloud tiering health state. + * + * @return the health value. + */ + public ServerEndpointHealthState health() { + return this.health; + } + + /** + * Get the healthLastUpdatedTimestamp property: The last updated timestamp of health state. + * + * @return the healthLastUpdatedTimestamp value. + */ + public OffsetDateTime healthLastUpdatedTimestamp() { + return this.healthLastUpdatedTimestamp; + } + + /** + * Get the lastCloudTieringResult property: Last cloud tiering result (HResult). + * + * @return the lastCloudTieringResult value. + */ + public Integer lastCloudTieringResult() { + return this.lastCloudTieringResult; + } + + /** + * Get the lastSuccessTimestamp property: Last cloud tiering success timestamp. + * + * @return the lastSuccessTimestamp value. + */ + public OffsetDateTime lastSuccessTimestamp() { + return this.lastSuccessTimestamp; + } + + /** + * Get the spaceSavings property: Information regarding how much local space cloud tiering is saving. + * + * @return the spaceSavings value. + */ + public CloudTieringSpaceSavings spaceSavings() { + return this.spaceSavings; + } + + /** + * Get the cachePerformance property: Information regarding how well the local cache on the server is performing. + * + * @return the cachePerformance value. + */ + public CloudTieringCachePerformance cachePerformance() { + return this.cachePerformance; + } + + /** + * Get the filesNotTiering property: Information regarding files that failed to be tiered. + * + * @return the filesNotTiering value. + */ + public CloudTieringFilesNotTiering filesNotTiering() { + return this.filesNotTiering; + } + + /** + * Get the volumeFreeSpacePolicyStatus property: Status of the volume free space policy. + * + * @return the volumeFreeSpacePolicyStatus value. + */ + public CloudTieringVolumeFreeSpacePolicyStatus volumeFreeSpacePolicyStatus() { + return this.volumeFreeSpacePolicyStatus; + } + + /** + * Get the datePolicyStatus property: Status of the date policy. + * + * @return the datePolicyStatus value. + */ + public CloudTieringDatePolicyStatus datePolicyStatus() { + return this.datePolicyStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (spaceSavings() != null) { + spaceSavings().validate(); + } + if (cachePerformance() != null) { + cachePerformance().validate(); + } + if (filesNotTiering() != null) { + filesNotTiering().validate(); + } + if (volumeFreeSpacePolicyStatus() != null) { + volumeFreeSpacePolicyStatus().validate(); + } + if (datePolicyStatus() != null) { + datePolicyStatus().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointCreateParameters.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointCreateParameters.java new file mode 100644 index 0000000000000..07d0ccdd42c9d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointCreateParameters.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used when creating a server endpoint. */ +@JsonFlatten +@Fluent +public class ServerEndpointCreateParameters extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointCreateParameters.class); + + /* + * Server Local path. + */ + @JsonProperty(value = "properties.serverLocalPath") + private String serverLocalPath; + + /* + * Cloud Tiering. + */ + @JsonProperty(value = "properties.cloudTiering") + private FeatureStatus cloudTiering; + + /* + * Level of free space to be maintained by Cloud Tiering if it is enabled. + */ + @JsonProperty(value = "properties.volumeFreeSpacePercent") + private Integer volumeFreeSpacePercent; + + /* + * Tier files older than days. + */ + @JsonProperty(value = "properties.tierFilesOlderThanDays") + private Integer tierFilesOlderThanDays; + + /* + * Friendly Name + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /* + * Server Resource Id. + */ + @JsonProperty(value = "properties.serverResourceId") + private String serverResourceId; + + /* + * Offline data transfer + */ + @JsonProperty(value = "properties.offlineDataTransfer") + private FeatureStatus offlineDataTransfer; + + /* + * Offline data transfer share name + */ + @JsonProperty(value = "properties.offlineDataTransferShareName") + private String offlineDataTransferShareName; + + /* + * Policy for how namespace and files are recalled during FastDr. + */ + @JsonProperty(value = "properties.initialDownloadPolicy") + private InitialDownloadPolicy initialDownloadPolicy; + + /* + * Policy for enabling follow-the-sun business models: link local cache to + * cloud behavior to pre-populate before local access. + */ + @JsonProperty(value = "properties.localCacheMode") + private LocalCacheMode localCacheMode; + + /* + * Policy for how the initial upload sync session is performed. + */ + @JsonProperty(value = "properties.initialUploadPolicy") + private InitialUploadPolicy initialUploadPolicy; + + /** + * Get the serverLocalPath property: Server Local path. + * + * @return the serverLocalPath value. + */ + public String serverLocalPath() { + return this.serverLocalPath; + } + + /** + * Set the serverLocalPath property: Server Local path. + * + * @param serverLocalPath the serverLocalPath value to set. + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withServerLocalPath(String serverLocalPath) { + this.serverLocalPath = serverLocalPath; + return this; + } + + /** + * Get the cloudTiering property: Cloud Tiering. + * + * @return the cloudTiering value. + */ + public FeatureStatus cloudTiering() { + return this.cloudTiering; + } + + /** + * Set the cloudTiering property: Cloud Tiering. + * + * @param cloudTiering the cloudTiering value to set. + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withCloudTiering(FeatureStatus cloudTiering) { + this.cloudTiering = cloudTiering; + return this; + } + + /** + * Get the volumeFreeSpacePercent property: Level of free space to be maintained by Cloud Tiering if it is enabled. + * + * @return the volumeFreeSpacePercent value. + */ + public Integer volumeFreeSpacePercent() { + return this.volumeFreeSpacePercent; + } + + /** + * Set the volumeFreeSpacePercent property: Level of free space to be maintained by Cloud Tiering if it is enabled. + * + * @param volumeFreeSpacePercent the volumeFreeSpacePercent value to set. + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withVolumeFreeSpacePercent(Integer volumeFreeSpacePercent) { + this.volumeFreeSpacePercent = volumeFreeSpacePercent; + return this; + } + + /** + * Get the tierFilesOlderThanDays property: Tier files older than days. + * + * @return the tierFilesOlderThanDays value. + */ + public Integer tierFilesOlderThanDays() { + return this.tierFilesOlderThanDays; + } + + /** + * Set the tierFilesOlderThanDays property: Tier files older than days. + * + * @param tierFilesOlderThanDays the tierFilesOlderThanDays value to set. + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withTierFilesOlderThanDays(Integer tierFilesOlderThanDays) { + this.tierFilesOlderThanDays = tierFilesOlderThanDays; + return this; + } + + /** + * Get the friendlyName property: Friendly Name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly Name. + * + * @param friendlyName the friendlyName value to set. + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the serverResourceId property: Server Resource Id. + * + * @return the serverResourceId value. + */ + public String serverResourceId() { + return this.serverResourceId; + } + + /** + * Set the serverResourceId property: Server Resource Id. + * + * @param serverResourceId the serverResourceId value to set. + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withServerResourceId(String serverResourceId) { + this.serverResourceId = serverResourceId; + return this; + } + + /** + * Get the offlineDataTransfer property: Offline data transfer. + * + * @return the offlineDataTransfer value. + */ + public FeatureStatus offlineDataTransfer() { + return this.offlineDataTransfer; + } + + /** + * Set the offlineDataTransfer property: Offline data transfer. + * + * @param offlineDataTransfer the offlineDataTransfer value to set. + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withOfflineDataTransfer(FeatureStatus offlineDataTransfer) { + this.offlineDataTransfer = offlineDataTransfer; + return this; + } + + /** + * Get the offlineDataTransferShareName property: Offline data transfer share name. + * + * @return the offlineDataTransferShareName value. + */ + public String offlineDataTransferShareName() { + return this.offlineDataTransferShareName; + } + + /** + * Set the offlineDataTransferShareName property: Offline data transfer share name. + * + * @param offlineDataTransferShareName the offlineDataTransferShareName value to set. + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withOfflineDataTransferShareName(String offlineDataTransferShareName) { + this.offlineDataTransferShareName = offlineDataTransferShareName; + return this; + } + + /** + * Get the initialDownloadPolicy property: Policy for how namespace and files are recalled during FastDr. + * + * @return the initialDownloadPolicy value. + */ + public InitialDownloadPolicy initialDownloadPolicy() { + return this.initialDownloadPolicy; + } + + /** + * Set the initialDownloadPolicy property: Policy for how namespace and files are recalled during FastDr. + * + * @param initialDownloadPolicy the initialDownloadPolicy value to set. + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withInitialDownloadPolicy(InitialDownloadPolicy initialDownloadPolicy) { + this.initialDownloadPolicy = initialDownloadPolicy; + return this; + } + + /** + * Get the localCacheMode property: Policy for enabling follow-the-sun business models: link local cache to cloud + * behavior to pre-populate before local access. + * + * @return the localCacheMode value. + */ + public LocalCacheMode localCacheMode() { + return this.localCacheMode; + } + + /** + * Set the localCacheMode property: Policy for enabling follow-the-sun business models: link local cache to cloud + * behavior to pre-populate before local access. + * + * @param localCacheMode the localCacheMode value to set. + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withLocalCacheMode(LocalCacheMode localCacheMode) { + this.localCacheMode = localCacheMode; + return this; + } + + /** + * Get the initialUploadPolicy property: Policy for how the initial upload sync session is performed. + * + * @return the initialUploadPolicy value. + */ + public InitialUploadPolicy initialUploadPolicy() { + return this.initialUploadPolicy; + } + + /** + * Set the initialUploadPolicy property: Policy for how the initial upload sync session is performed. + * + * @param initialUploadPolicy the initialUploadPolicy value to set. + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withInitialUploadPolicy(InitialUploadPolicy initialUploadPolicy) { + this.initialUploadPolicy = initialUploadPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointFilesNotSyncingError.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointFilesNotSyncingError.java new file mode 100644 index 0000000000000..9e0b1b5a3ba94 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointFilesNotSyncingError.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Files not syncing error object. */ +@Immutable +public final class ServerEndpointFilesNotSyncingError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointFilesNotSyncingError.class); + + /* + * Error code (HResult) + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private Integer errorCode; + + /* + * Count of persistent files not syncing with the specified error code + */ + @JsonProperty(value = "persistentCount", access = JsonProperty.Access.WRITE_ONLY) + private Long persistentCount; + + /* + * Count of transient files not syncing with the specified error code + */ + @JsonProperty(value = "transientCount", access = JsonProperty.Access.WRITE_ONLY) + private Long transientCount; + + /** + * Get the errorCode property: Error code (HResult). + * + * @return the errorCode value. + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Get the persistentCount property: Count of persistent files not syncing with the specified error code. + * + * @return the persistentCount value. + */ + public Long persistentCount() { + return this.persistentCount; + } + + /** + * Get the transientCount property: Count of transient files not syncing with the specified error code. + * + * @return the transientCount value. + */ + public Long transientCount() { + return this.transientCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointHealthState.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointHealthState.java new file mode 100644 index 0000000000000..c3f77e4c4ba9f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointHealthState.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServerEndpointHealthState. */ +public final class ServerEndpointHealthState extends ExpandableStringEnum { + /** Static value Unavailable for ServerEndpointHealthState. */ + public static final ServerEndpointHealthState UNAVAILABLE = fromString("Unavailable"); + + /** Static value Healthy for ServerEndpointHealthState. */ + public static final ServerEndpointHealthState HEALTHY = fromString("Healthy"); + + /** Static value Error for ServerEndpointHealthState. */ + public static final ServerEndpointHealthState ERROR = fromString("Error"); + + /** + * Creates or finds a ServerEndpointHealthState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerEndpointHealthState. + */ + @JsonCreator + public static ServerEndpointHealthState fromString(String name) { + return fromString(name, ServerEndpointHealthState.class); + } + + /** @return known ServerEndpointHealthState values. */ + public static Collection values() { + return values(ServerEndpointHealthState.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointOfflineDataTransferState.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointOfflineDataTransferState.java new file mode 100644 index 0000000000000..80c572b5adc8c --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointOfflineDataTransferState.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServerEndpointOfflineDataTransferState. */ +public final class ServerEndpointOfflineDataTransferState + extends ExpandableStringEnum { + /** Static value InProgress for ServerEndpointOfflineDataTransferState. */ + public static final ServerEndpointOfflineDataTransferState IN_PROGRESS = fromString("InProgress"); + + /** Static value Stopping for ServerEndpointOfflineDataTransferState. */ + public static final ServerEndpointOfflineDataTransferState STOPPING = fromString("Stopping"); + + /** Static value NotRunning for ServerEndpointOfflineDataTransferState. */ + public static final ServerEndpointOfflineDataTransferState NOT_RUNNING = fromString("NotRunning"); + + /** Static value Complete for ServerEndpointOfflineDataTransferState. */ + public static final ServerEndpointOfflineDataTransferState COMPLETE = fromString("Complete"); + + /** + * Creates or finds a ServerEndpointOfflineDataTransferState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerEndpointOfflineDataTransferState. + */ + @JsonCreator + public static ServerEndpointOfflineDataTransferState fromString(String name) { + return fromString(name, ServerEndpointOfflineDataTransferState.class); + } + + /** @return known ServerEndpointOfflineDataTransferState values. */ + public static Collection values() { + return values(ServerEndpointOfflineDataTransferState.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointRecallError.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointRecallError.java new file mode 100644 index 0000000000000..4bfcfb16c5854 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointRecallError.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Server endpoint recall error object. */ +@Immutable +public final class ServerEndpointRecallError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointRecallError.class); + + /* + * Error code (HResult) + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private Integer errorCode; + + /* + * Count of occurences of the error + */ + @JsonProperty(value = "count", access = JsonProperty.Access.WRITE_ONLY) + private Long count; + + /** + * Get the errorCode property: Error code (HResult). + * + * @return the errorCode value. + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Get the count property: Count of occurences of the error. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointRecallStatus.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointRecallStatus.java new file mode 100644 index 0000000000000..82d1ee0beabd6 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointRecallStatus.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Server endpoint recall status object. */ +@Immutable +public final class ServerEndpointRecallStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointRecallStatus.class); + + /* + * Last updated timestamp + */ + @JsonProperty(value = "lastUpdatedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTimestamp; + + /* + * Total count of recall errors. + */ + @JsonProperty(value = "totalRecallErrorsCount", access = JsonProperty.Access.WRITE_ONLY) + private Long totalRecallErrorsCount; + + /* + * Array of recall errors + */ + @JsonProperty(value = "recallErrors", access = JsonProperty.Access.WRITE_ONLY) + private List recallErrors; + + /** + * Get the lastUpdatedTimestamp property: Last updated timestamp. + * + * @return the lastUpdatedTimestamp value. + */ + public OffsetDateTime lastUpdatedTimestamp() { + return this.lastUpdatedTimestamp; + } + + /** + * Get the totalRecallErrorsCount property: Total count of recall errors. + * + * @return the totalRecallErrorsCount value. + */ + public Long totalRecallErrorsCount() { + return this.totalRecallErrorsCount; + } + + /** + * Get the recallErrors property: Array of recall errors. + * + * @return the recallErrors value. + */ + public List recallErrors() { + return this.recallErrors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (recallErrors() != null) { + recallErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncActivityState.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncActivityState.java new file mode 100644 index 0000000000000..40e3680cf1cb5 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncActivityState.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServerEndpointSyncActivityState. */ +public final class ServerEndpointSyncActivityState extends ExpandableStringEnum { + /** Static value Upload for ServerEndpointSyncActivityState. */ + public static final ServerEndpointSyncActivityState UPLOAD = fromString("Upload"); + + /** Static value Download for ServerEndpointSyncActivityState. */ + public static final ServerEndpointSyncActivityState DOWNLOAD = fromString("Download"); + + /** Static value UploadAndDownload for ServerEndpointSyncActivityState. */ + public static final ServerEndpointSyncActivityState UPLOAD_AND_DOWNLOAD = fromString("UploadAndDownload"); + + /** + * Creates or finds a ServerEndpointSyncActivityState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerEndpointSyncActivityState. + */ + @JsonCreator + public static ServerEndpointSyncActivityState fromString(String name) { + return fromString(name, ServerEndpointSyncActivityState.class); + } + + /** @return known ServerEndpointSyncActivityState values. */ + public static Collection values() { + return values(ServerEndpointSyncActivityState.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncActivityStatus.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncActivityStatus.java new file mode 100644 index 0000000000000..8166fa1a601ba --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncActivityStatus.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Sync Session status object. */ +@Immutable +public final class ServerEndpointSyncActivityStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointSyncActivityStatus.class); + + /* + * Timestamp when properties were updated + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /* + * Per item error count + */ + @JsonProperty(value = "perItemErrorCount", access = JsonProperty.Access.WRITE_ONLY) + private Long perItemErrorCount; + + /* + * Applied item count. + */ + @JsonProperty(value = "appliedItemCount", access = JsonProperty.Access.WRITE_ONLY) + private Long appliedItemCount; + + /* + * Total item count (if available) + */ + @JsonProperty(value = "totalItemCount", access = JsonProperty.Access.WRITE_ONLY) + private Long totalItemCount; + + /* + * Applied bytes + */ + @JsonProperty(value = "appliedBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long appliedBytes; + + /* + * Total bytes (if available) + */ + @JsonProperty(value = "totalBytes", access = JsonProperty.Access.WRITE_ONLY) + private Long totalBytes; + + /* + * Sync mode + */ + @JsonProperty(value = "syncMode", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointSyncMode syncMode; + + /* + * Session minutes remaining (if available) + */ + @JsonProperty(value = "sessionMinutesRemaining", access = JsonProperty.Access.WRITE_ONLY) + private Integer sessionMinutesRemaining; + + /** + * Get the timestamp property: Timestamp when properties were updated. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the perItemErrorCount property: Per item error count. + * + * @return the perItemErrorCount value. + */ + public Long perItemErrorCount() { + return this.perItemErrorCount; + } + + /** + * Get the appliedItemCount property: Applied item count. + * + * @return the appliedItemCount value. + */ + public Long appliedItemCount() { + return this.appliedItemCount; + } + + /** + * Get the totalItemCount property: Total item count (if available). + * + * @return the totalItemCount value. + */ + public Long totalItemCount() { + return this.totalItemCount; + } + + /** + * Get the appliedBytes property: Applied bytes. + * + * @return the appliedBytes value. + */ + public Long appliedBytes() { + return this.appliedBytes; + } + + /** + * Get the totalBytes property: Total bytes (if available). + * + * @return the totalBytes value. + */ + public Long totalBytes() { + return this.totalBytes; + } + + /** + * Get the syncMode property: Sync mode. + * + * @return the syncMode value. + */ + public ServerEndpointSyncMode syncMode() { + return this.syncMode; + } + + /** + * Get the sessionMinutesRemaining property: Session minutes remaining (if available). + * + * @return the sessionMinutesRemaining value. + */ + public Integer sessionMinutesRemaining() { + return this.sessionMinutesRemaining; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncMode.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncMode.java new file mode 100644 index 0000000000000..a722973a0fa22 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncMode.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServerEndpointSyncMode. */ +public final class ServerEndpointSyncMode extends ExpandableStringEnum { + /** Static value Regular for ServerEndpointSyncMode. */ + public static final ServerEndpointSyncMode REGULAR = fromString("Regular"); + + /** Static value NamespaceDownload for ServerEndpointSyncMode. */ + public static final ServerEndpointSyncMode NAMESPACE_DOWNLOAD = fromString("NamespaceDownload"); + + /** Static value InitialUpload for ServerEndpointSyncMode. */ + public static final ServerEndpointSyncMode INITIAL_UPLOAD = fromString("InitialUpload"); + + /** Static value SnapshotUpload for ServerEndpointSyncMode. */ + public static final ServerEndpointSyncMode SNAPSHOT_UPLOAD = fromString("SnapshotUpload"); + + /** Static value InitialFullDownload for ServerEndpointSyncMode. */ + public static final ServerEndpointSyncMode INITIAL_FULL_DOWNLOAD = fromString("InitialFullDownload"); + + /** + * Creates or finds a ServerEndpointSyncMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerEndpointSyncMode. + */ + @JsonCreator + public static ServerEndpointSyncMode fromString(String name) { + return fromString(name, ServerEndpointSyncMode.class); + } + + /** @return known ServerEndpointSyncMode values. */ + public static Collection values() { + return values(ServerEndpointSyncMode.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncSessionStatus.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncSessionStatus.java new file mode 100644 index 0000000000000..d4e7914627c9a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncSessionStatus.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Sync Session status object. */ +@Immutable +public final class ServerEndpointSyncSessionStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointSyncSessionStatus.class); + + /* + * Last sync result (HResult) + */ + @JsonProperty(value = "lastSyncResult", access = JsonProperty.Access.WRITE_ONLY) + private Integer lastSyncResult; + + /* + * Last sync timestamp + */ + @JsonProperty(value = "lastSyncTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastSyncTimestamp; + + /* + * Last sync success timestamp + */ + @JsonProperty(value = "lastSyncSuccessTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastSyncSuccessTimestamp; + + /* + * Last sync per item error count. + */ + @JsonProperty(value = "lastSyncPerItemErrorCount", access = JsonProperty.Access.WRITE_ONLY) + private Long lastSyncPerItemErrorCount; + + /* + * Count of persistent files not syncing. + */ + @JsonProperty(value = "persistentFilesNotSyncingCount", access = JsonProperty.Access.WRITE_ONLY) + private Long persistentFilesNotSyncingCount; + + /* + * Count of transient files not syncing. + */ + @JsonProperty(value = "transientFilesNotSyncingCount", access = JsonProperty.Access.WRITE_ONLY) + private Long transientFilesNotSyncingCount; + + /* + * Array of per-item errors coming from the last sync session. + */ + @JsonProperty(value = "filesNotSyncingErrors", access = JsonProperty.Access.WRITE_ONLY) + private List filesNotSyncingErrors; + + /* + * Sync mode + */ + @JsonProperty(value = "lastSyncMode", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointSyncMode lastSyncMode; + + /** + * Get the lastSyncResult property: Last sync result (HResult). + * + * @return the lastSyncResult value. + */ + public Integer lastSyncResult() { + return this.lastSyncResult; + } + + /** + * Get the lastSyncTimestamp property: Last sync timestamp. + * + * @return the lastSyncTimestamp value. + */ + public OffsetDateTime lastSyncTimestamp() { + return this.lastSyncTimestamp; + } + + /** + * Get the lastSyncSuccessTimestamp property: Last sync success timestamp. + * + * @return the lastSyncSuccessTimestamp value. + */ + public OffsetDateTime lastSyncSuccessTimestamp() { + return this.lastSyncSuccessTimestamp; + } + + /** + * Get the lastSyncPerItemErrorCount property: Last sync per item error count. + * + * @return the lastSyncPerItemErrorCount value. + */ + public Long lastSyncPerItemErrorCount() { + return this.lastSyncPerItemErrorCount; + } + + /** + * Get the persistentFilesNotSyncingCount property: Count of persistent files not syncing. + * + * @return the persistentFilesNotSyncingCount value. + */ + public Long persistentFilesNotSyncingCount() { + return this.persistentFilesNotSyncingCount; + } + + /** + * Get the transientFilesNotSyncingCount property: Count of transient files not syncing. + * + * @return the transientFilesNotSyncingCount value. + */ + public Long transientFilesNotSyncingCount() { + return this.transientFilesNotSyncingCount; + } + + /** + * Get the filesNotSyncingErrors property: Array of per-item errors coming from the last sync session. + * + * @return the filesNotSyncingErrors value. + */ + public List filesNotSyncingErrors() { + return this.filesNotSyncingErrors; + } + + /** + * Get the lastSyncMode property: Sync mode. + * + * @return the lastSyncMode value. + */ + public ServerEndpointSyncMode lastSyncMode() { + return this.lastSyncMode; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (filesNotSyncingErrors() != null) { + filesNotSyncingErrors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncStatus.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncStatus.java new file mode 100644 index 0000000000000..8cb76576c9c20 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncStatus.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Server Endpoint sync status. */ +@Immutable +public final class ServerEndpointSyncStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointSyncStatus.class); + + /* + * Download Health Status. + */ + @JsonProperty(value = "downloadHealth", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointHealthState downloadHealth; + + /* + * Upload Health Status. + */ + @JsonProperty(value = "uploadHealth", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointHealthState uploadHealth; + + /* + * Combined Health Status. + */ + @JsonProperty(value = "combinedHealth", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointHealthState combinedHealth; + + /* + * Sync activity + */ + @JsonProperty(value = "syncActivity", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointSyncActivityState syncActivity; + + /* + * Total count of persistent files not syncing (combined upload + + * download). + */ + @JsonProperty(value = "totalPersistentFilesNotSyncingCount", access = JsonProperty.Access.WRITE_ONLY) + private Long totalPersistentFilesNotSyncingCount; + + /* + * Last Updated Timestamp + */ + @JsonProperty(value = "lastUpdatedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTimestamp; + + /* + * Upload Status + */ + @JsonProperty(value = "uploadStatus", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointSyncSessionStatus uploadStatus; + + /* + * Download Status + */ + @JsonProperty(value = "downloadStatus", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointSyncSessionStatus downloadStatus; + + /* + * Upload sync activity + */ + @JsonProperty(value = "uploadActivity", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointSyncActivityStatus uploadActivity; + + /* + * Download sync activity + */ + @JsonProperty(value = "downloadActivity", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointSyncActivityStatus downloadActivity; + + /* + * Offline Data Transfer State + */ + @JsonProperty(value = "offlineDataTransferStatus", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointOfflineDataTransferState offlineDataTransferStatus; + + /* + * Background data download activity + */ + @JsonProperty(value = "backgroundDataDownloadActivity", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointBackgroundDataDownloadActivity backgroundDataDownloadActivity; + + /** + * Get the downloadHealth property: Download Health Status. + * + * @return the downloadHealth value. + */ + public ServerEndpointHealthState downloadHealth() { + return this.downloadHealth; + } + + /** + * Get the uploadHealth property: Upload Health Status. + * + * @return the uploadHealth value. + */ + public ServerEndpointHealthState uploadHealth() { + return this.uploadHealth; + } + + /** + * Get the combinedHealth property: Combined Health Status. + * + * @return the combinedHealth value. + */ + public ServerEndpointHealthState combinedHealth() { + return this.combinedHealth; + } + + /** + * Get the syncActivity property: Sync activity. + * + * @return the syncActivity value. + */ + public ServerEndpointSyncActivityState syncActivity() { + return this.syncActivity; + } + + /** + * Get the totalPersistentFilesNotSyncingCount property: Total count of persistent files not syncing (combined + * upload + download). + * + * @return the totalPersistentFilesNotSyncingCount value. + */ + public Long totalPersistentFilesNotSyncingCount() { + return this.totalPersistentFilesNotSyncingCount; + } + + /** + * Get the lastUpdatedTimestamp property: Last Updated Timestamp. + * + * @return the lastUpdatedTimestamp value. + */ + public OffsetDateTime lastUpdatedTimestamp() { + return this.lastUpdatedTimestamp; + } + + /** + * Get the uploadStatus property: Upload Status. + * + * @return the uploadStatus value. + */ + public ServerEndpointSyncSessionStatus uploadStatus() { + return this.uploadStatus; + } + + /** + * Get the downloadStatus property: Download Status. + * + * @return the downloadStatus value. + */ + public ServerEndpointSyncSessionStatus downloadStatus() { + return this.downloadStatus; + } + + /** + * Get the uploadActivity property: Upload sync activity. + * + * @return the uploadActivity value. + */ + public ServerEndpointSyncActivityStatus uploadActivity() { + return this.uploadActivity; + } + + /** + * Get the downloadActivity property: Download sync activity. + * + * @return the downloadActivity value. + */ + public ServerEndpointSyncActivityStatus downloadActivity() { + return this.downloadActivity; + } + + /** + * Get the offlineDataTransferStatus property: Offline Data Transfer State. + * + * @return the offlineDataTransferStatus value. + */ + public ServerEndpointOfflineDataTransferState offlineDataTransferStatus() { + return this.offlineDataTransferStatus; + } + + /** + * Get the backgroundDataDownloadActivity property: Background data download activity. + * + * @return the backgroundDataDownloadActivity value. + */ + public ServerEndpointBackgroundDataDownloadActivity backgroundDataDownloadActivity() { + return this.backgroundDataDownloadActivity; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (uploadStatus() != null) { + uploadStatus().validate(); + } + if (downloadStatus() != null) { + downloadStatus().validate(); + } + if (uploadActivity() != null) { + uploadActivity().validate(); + } + if (downloadActivity() != null) { + downloadActivity().validate(); + } + if (backgroundDataDownloadActivity() != null) { + backgroundDataDownloadActivity().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointUpdateParameters.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointUpdateParameters.java new file mode 100644 index 0000000000000..3cc57d2e2b7b8 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointUpdateParameters.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters for updating an Server Endpoint. */ +@JsonFlatten +@Fluent +public class ServerEndpointUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointUpdateParameters.class); + + /* + * Cloud Tiering. + */ + @JsonProperty(value = "properties.cloudTiering") + private FeatureStatus cloudTiering; + + /* + * Level of free space to be maintained by Cloud Tiering if it is enabled. + */ + @JsonProperty(value = "properties.volumeFreeSpacePercent") + private Integer volumeFreeSpacePercent; + + /* + * Tier files older than days. + */ + @JsonProperty(value = "properties.tierFilesOlderThanDays") + private Integer tierFilesOlderThanDays; + + /* + * Offline data transfer + */ + @JsonProperty(value = "properties.offlineDataTransfer") + private FeatureStatus offlineDataTransfer; + + /* + * Offline data transfer share name + */ + @JsonProperty(value = "properties.offlineDataTransferShareName") + private String offlineDataTransferShareName; + + /* + * Policy for enabling follow-the-sun business models: link local cache to + * cloud behavior to pre-populate before local access. + */ + @JsonProperty(value = "properties.localCacheMode") + private LocalCacheMode localCacheMode; + + /** + * Get the cloudTiering property: Cloud Tiering. + * + * @return the cloudTiering value. + */ + public FeatureStatus cloudTiering() { + return this.cloudTiering; + } + + /** + * Set the cloudTiering property: Cloud Tiering. + * + * @param cloudTiering the cloudTiering value to set. + * @return the ServerEndpointUpdateParameters object itself. + */ + public ServerEndpointUpdateParameters withCloudTiering(FeatureStatus cloudTiering) { + this.cloudTiering = cloudTiering; + return this; + } + + /** + * Get the volumeFreeSpacePercent property: Level of free space to be maintained by Cloud Tiering if it is enabled. + * + * @return the volumeFreeSpacePercent value. + */ + public Integer volumeFreeSpacePercent() { + return this.volumeFreeSpacePercent; + } + + /** + * Set the volumeFreeSpacePercent property: Level of free space to be maintained by Cloud Tiering if it is enabled. + * + * @param volumeFreeSpacePercent the volumeFreeSpacePercent value to set. + * @return the ServerEndpointUpdateParameters object itself. + */ + public ServerEndpointUpdateParameters withVolumeFreeSpacePercent(Integer volumeFreeSpacePercent) { + this.volumeFreeSpacePercent = volumeFreeSpacePercent; + return this; + } + + /** + * Get the tierFilesOlderThanDays property: Tier files older than days. + * + * @return the tierFilesOlderThanDays value. + */ + public Integer tierFilesOlderThanDays() { + return this.tierFilesOlderThanDays; + } + + /** + * Set the tierFilesOlderThanDays property: Tier files older than days. + * + * @param tierFilesOlderThanDays the tierFilesOlderThanDays value to set. + * @return the ServerEndpointUpdateParameters object itself. + */ + public ServerEndpointUpdateParameters withTierFilesOlderThanDays(Integer tierFilesOlderThanDays) { + this.tierFilesOlderThanDays = tierFilesOlderThanDays; + return this; + } + + /** + * Get the offlineDataTransfer property: Offline data transfer. + * + * @return the offlineDataTransfer value. + */ + public FeatureStatus offlineDataTransfer() { + return this.offlineDataTransfer; + } + + /** + * Set the offlineDataTransfer property: Offline data transfer. + * + * @param offlineDataTransfer the offlineDataTransfer value to set. + * @return the ServerEndpointUpdateParameters object itself. + */ + public ServerEndpointUpdateParameters withOfflineDataTransfer(FeatureStatus offlineDataTransfer) { + this.offlineDataTransfer = offlineDataTransfer; + return this; + } + + /** + * Get the offlineDataTransferShareName property: Offline data transfer share name. + * + * @return the offlineDataTransferShareName value. + */ + public String offlineDataTransferShareName() { + return this.offlineDataTransferShareName; + } + + /** + * Set the offlineDataTransferShareName property: Offline data transfer share name. + * + * @param offlineDataTransferShareName the offlineDataTransferShareName value to set. + * @return the ServerEndpointUpdateParameters object itself. + */ + public ServerEndpointUpdateParameters withOfflineDataTransferShareName(String offlineDataTransferShareName) { + this.offlineDataTransferShareName = offlineDataTransferShareName; + return this; + } + + /** + * Get the localCacheMode property: Policy for enabling follow-the-sun business models: link local cache to cloud + * behavior to pre-populate before local access. + * + * @return the localCacheMode value. + */ + public LocalCacheMode localCacheMode() { + return this.localCacheMode; + } + + /** + * Set the localCacheMode property: Policy for enabling follow-the-sun business models: link local cache to cloud + * behavior to pre-populate before local access. + * + * @param localCacheMode the localCacheMode value to set. + * @return the ServerEndpointUpdateParameters object itself. + */ + public ServerEndpointUpdateParameters withLocalCacheMode(LocalCacheMode localCacheMode) { + this.localCacheMode = localCacheMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpoints.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpoints.java new file mode 100644 index 0000000000000..13b3d338f6216 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpoints.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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 ServerEndpoints. */ +public interface ServerEndpoints { + /** + * Get a ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint. + */ + ServerEndpoint get( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName); + + /** + * Get a ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint. + */ + Response getWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + Context context); + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, String syncGroupName, String serverEndpointName); + + /** + * Delete a given ServerEndpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + Context context); + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint list. + */ + PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName); + + /** + * Get a ServerEndpoint list. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint list. + */ + PagedIterable listBySyncGroup( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context); + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void recallAction( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters); + + /** + * Recall a server endpoint. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param serverEndpointName Name of Server Endpoint object. + * @param parameters Body of Recall Action object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void recallAction( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String serverEndpointName, + RecallActionParameters parameters, + Context context); + + /** + * Get a ServerEndpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint. + */ + ServerEndpoint getById(String id); + + /** + * Get a ServerEndpoint. + * + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ServerEndpoint. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a given ServerEndpoint. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 given ServerEndpoint. + * + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 ServerEndpoint resource. + * + * @param name resource name. + * @return the first stage of the new ServerEndpoint definition. + */ + ServerEndpoint.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsCreateHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsCreateHeaders.java new file mode 100644 index 0000000000000..ae425f24e6ced --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsCreateHeaders.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ServerEndpointsCreateHeaders model. */ +@Fluent +public final class ServerEndpointsCreateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointsCreateHeaders.class); + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the ServerEndpointsCreateHeaders object itself. + */ + public ServerEndpointsCreateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the ServerEndpointsCreateHeaders object itself. + */ + public ServerEndpointsCreateHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the ServerEndpointsCreateHeaders object itself. + */ + public ServerEndpointsCreateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the ServerEndpointsCreateHeaders object itself. + */ + public ServerEndpointsCreateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsCreateResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsCreateResponse.java new file mode 100644 index 0000000000000..96dae409d5d7b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsCreateResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.ServerEndpointInner; + +/** Contains all response data for the create operation. */ +public final class ServerEndpointsCreateResponse + extends ResponseBase { + /** + * Creates an instance of ServerEndpointsCreateResponse. + * + * @param request the request which resulted in this ServerEndpointsCreateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ServerEndpointsCreateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ServerEndpointInner value, + ServerEndpointsCreateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ServerEndpointInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsDeleteHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsDeleteHeaders.java new file mode 100644 index 0000000000000..ca034ff45d74a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsDeleteHeaders.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ServerEndpointsDeleteHeaders model. */ +@Fluent +public final class ServerEndpointsDeleteHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointsDeleteHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the ServerEndpointsDeleteHeaders object itself. + */ + public ServerEndpointsDeleteHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the ServerEndpointsDeleteHeaders object itself. + */ + public ServerEndpointsDeleteHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the ServerEndpointsDeleteHeaders object itself. + */ + public ServerEndpointsDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsDeleteResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsDeleteResponse.java new file mode 100644 index 0000000000000..2148300c2fb97 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsDeleteResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the delete operation. */ +public final class ServerEndpointsDeleteResponse extends ResponseBase { + /** + * Creates an instance of ServerEndpointsDeleteResponse. + * + * @param request the request which resulted in this ServerEndpointsDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ServerEndpointsDeleteResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, ServerEndpointsDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsGetHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsGetHeaders.java new file mode 100644 index 0000000000000..440fd5a589fa3 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsGetHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ServerEndpointsGetHeaders model. */ +@Fluent +public final class ServerEndpointsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointsGetHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the ServerEndpointsGetHeaders object itself. + */ + public ServerEndpointsGetHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the ServerEndpointsGetHeaders object itself. + */ + public ServerEndpointsGetHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsGetResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsGetResponse.java new file mode 100644 index 0000000000000..f6348b469b0f6 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsGetResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.ServerEndpointInner; + +/** Contains all response data for the get operation. */ +public final class ServerEndpointsGetResponse extends ResponseBase { + /** + * Creates an instance of ServerEndpointsGetResponse. + * + * @param request the request which resulted in this ServerEndpointsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ServerEndpointsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ServerEndpointInner value, + ServerEndpointsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ServerEndpointInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsListBySyncGroupHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsListBySyncGroupHeaders.java new file mode 100644 index 0000000000000..3b197043af44a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsListBySyncGroupHeaders.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ServerEndpointsListBySyncGroupHeaders model. */ +@Fluent +public final class ServerEndpointsListBySyncGroupHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointsListBySyncGroupHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the ServerEndpointsListBySyncGroupHeaders object itself. + */ + public ServerEndpointsListBySyncGroupHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the ServerEndpointsListBySyncGroupHeaders object itself. + */ + public ServerEndpointsListBySyncGroupHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the ServerEndpointsListBySyncGroupHeaders object itself. + */ + public ServerEndpointsListBySyncGroupHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsListBySyncGroupResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsListBySyncGroupResponse.java new file mode 100644 index 0000000000000..863789a9de0d0 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsListBySyncGroupResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the listBySyncGroup operation. */ +public final class ServerEndpointsListBySyncGroupResponse + extends ResponseBase { + /** + * Creates an instance of ServerEndpointsListBySyncGroupResponse. + * + * @param request the request which resulted in this ServerEndpointsListBySyncGroupResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ServerEndpointsListBySyncGroupResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ServerEndpointArray value, + ServerEndpointsListBySyncGroupHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ServerEndpointArray getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsRecallActionHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsRecallActionHeaders.java new file mode 100644 index 0000000000000..1b3684edc0c4b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsRecallActionHeaders.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ServerEndpointsRecallActionHeaders model. */ +@Fluent +public final class ServerEndpointsRecallActionHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointsRecallActionHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the ServerEndpointsRecallActionHeaders object itself. + */ + public ServerEndpointsRecallActionHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the ServerEndpointsRecallActionHeaders object itself. + */ + public ServerEndpointsRecallActionHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the ServerEndpointsRecallActionHeaders object itself. + */ + public ServerEndpointsRecallActionHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsRecallActionResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsRecallActionResponse.java new file mode 100644 index 0000000000000..986068452ef5e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsRecallActionResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the recallAction operation. */ +public final class ServerEndpointsRecallActionResponse extends ResponseBase { + /** + * Creates an instance of ServerEndpointsRecallActionResponse. + * + * @param request the request which resulted in this ServerEndpointsRecallActionResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ServerEndpointsRecallActionResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + ServerEndpointsRecallActionHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsUpdateHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsUpdateHeaders.java new file mode 100644 index 0000000000000..6ba00e2fce0ba --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsUpdateHeaders.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ServerEndpointsUpdateHeaders model. */ +@Fluent +public final class ServerEndpointsUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerEndpointsUpdateHeaders.class); + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the ServerEndpointsUpdateHeaders object itself. + */ + public ServerEndpointsUpdateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the ServerEndpointsUpdateHeaders object itself. + */ + public ServerEndpointsUpdateHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the ServerEndpointsUpdateHeaders object itself. + */ + public ServerEndpointsUpdateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the ServerEndpointsUpdateHeaders object itself. + */ + public ServerEndpointsUpdateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsUpdateResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsUpdateResponse.java new file mode 100644 index 0000000000000..b612d6655da15 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsUpdateResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.ServerEndpointInner; + +/** Contains all response data for the update operation. */ +public final class ServerEndpointsUpdateResponse + extends ResponseBase { + /** + * Creates an instance of ServerEndpointsUpdateResponse. + * + * @param request the request which resulted in this ServerEndpointsUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public ServerEndpointsUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + ServerEndpointInner value, + ServerEndpointsUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public ServerEndpointInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncApiError.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncApiError.java new file mode 100644 index 0000000000000..d00bbce09a106 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncApiError.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Error type. */ +@Immutable +public final class StorageSyncApiError extends ManagementError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageSyncApiError.class); + + /* + * Inner error details of the given entry. + */ + @JsonProperty(value = "innerError", access = JsonProperty.Access.WRITE_ONLY) + private StorageSyncInnerErrorDetails innerError; + + /** + * Get the innerError property: Inner error details of the given entry. + * + * @return the innerError value. + */ + public StorageSyncInnerErrorDetails getInnerError() { + return this.innerError; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (getInnerError() != null) { + getInnerError().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncApiErrorException.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncApiErrorException.java new file mode 100644 index 0000000000000..f7f1d0f0070df --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncApiErrorException.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpResponse; +import com.azure.core.management.exception.ManagementException; + +/** Exception thrown for an invalid response with StorageSyncApiError information. */ +public final class StorageSyncApiErrorException extends ManagementException { + /** + * Initializes a new instance of the StorageSyncApiErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + */ + public StorageSyncApiErrorException(String message, HttpResponse response) { + super(message, response); + } + + /** + * Initializes a new instance of the StorageSyncApiErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + * @param value the deserialized response value. + */ + public StorageSyncApiErrorException(String message, HttpResponse response, StorageSyncApiError value) { + super(message, response, value); + } + + @Override + public StorageSyncApiError getValue() { + return (StorageSyncApiError) super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncInnerErrorDetails.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncInnerErrorDetails.java new file mode 100644 index 0000000000000..f60747ecba815 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncInnerErrorDetails.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Error Details object. */ +@Fluent +public final class StorageSyncInnerErrorDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageSyncInnerErrorDetails.class); + + /* + * Call stack of the error. + */ + @JsonProperty(value = "callStack") + private String callStack; + + /* + * Error message of the error. + */ + @JsonProperty(value = "message") + private String message; + + /* + * Exception of the inner error. + */ + @JsonProperty(value = "innerException") + private String innerException; + + /* + * Call stack of the inner error. + */ + @JsonProperty(value = "innerExceptionCallStack") + private String innerExceptionCallStack; + + /** + * Get the callStack property: Call stack of the error. + * + * @return the callStack value. + */ + public String callStack() { + return this.callStack; + } + + /** + * Set the callStack property: Call stack of the error. + * + * @param callStack the callStack value to set. + * @return the StorageSyncInnerErrorDetails object itself. + */ + public StorageSyncInnerErrorDetails withCallStack(String callStack) { + this.callStack = callStack; + return this; + } + + /** + * Get the message property: Error message of the error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Error message of the error. + * + * @param message the message value to set. + * @return the StorageSyncInnerErrorDetails object itself. + */ + public StorageSyncInnerErrorDetails withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the innerException property: Exception of the inner error. + * + * @return the innerException value. + */ + public String innerException() { + return this.innerException; + } + + /** + * Set the innerException property: Exception of the inner error. + * + * @param innerException the innerException value to set. + * @return the StorageSyncInnerErrorDetails object itself. + */ + public StorageSyncInnerErrorDetails withInnerException(String innerException) { + this.innerException = innerException; + return this; + } + + /** + * Get the innerExceptionCallStack property: Call stack of the inner error. + * + * @return the innerExceptionCallStack value. + */ + public String innerExceptionCallStack() { + return this.innerExceptionCallStack; + } + + /** + * Set the innerExceptionCallStack property: Call stack of the inner error. + * + * @param innerExceptionCallStack the innerExceptionCallStack value to set. + * @return the StorageSyncInnerErrorDetails object itself. + */ + public StorageSyncInnerErrorDetails withInnerExceptionCallStack(String innerExceptionCallStack) { + this.innerExceptionCallStack = innerExceptionCallStack; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncService.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncService.java new file mode 100644 index 0000000000000..5737abacb9a44 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncService.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.fluent.models.StorageSyncServiceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of StorageSyncService. */ +public interface StorageSyncService { + /** + * 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 incomingTrafficPolicy property: Incoming Traffic Policy. + * + * @return the incomingTrafficPolicy value. + */ + IncomingTrafficPolicy incomingTrafficPolicy(); + + /** + * Gets the storageSyncServiceStatus property: Storage Sync service status. + * + * @return the storageSyncServiceStatus value. + */ + Integer storageSyncServiceStatus(); + + /** + * Gets the storageSyncServiceUid property: Storage Sync service Uid. + * + * @return the storageSyncServiceUid value. + */ + String storageSyncServiceUid(); + + /** + * Gets the provisioningState property: StorageSyncService Provisioning State. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the lastWorkflowId property: StorageSyncService lastWorkflowId. + * + * @return the lastWorkflowId value. + */ + String lastWorkflowId(); + + /** + * Gets the lastOperationName property: Resource Last Operation Name. + * + * @return the lastOperationName value. + */ + String lastOperationName(); + + /** + * Gets the privateEndpointConnections property: List of private endpoint connection associated with the specified + * storage sync service. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.storagesync.fluent.models.StorageSyncServiceInner object. + * + * @return the inner object. + */ + StorageSyncServiceInner innerModel(); + + /** The entirety of the StorageSyncService definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The StorageSyncService definition stages. */ + interface DefinitionStages { + /** The first stage of the StorageSyncService definition. */ + interface Blank extends WithLocation { + } + /** The stage of the StorageSyncService definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location Required. Gets or sets the location of the resource. This will be one of the supported + * and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + * resource cannot be changed once it is created, but if an identical geo region is specified on update, + * the request will succeed. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location Required. Gets or sets the location of the resource. This will be one of the supported + * and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + * resource cannot be changed once it is created, but if an identical geo region is specified on update, + * the request will succeed. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the StorageSyncService 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 StorageSyncService 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.WithIncomingTrafficPolicy { + /** + * Executes the create request. + * + * @return the created resource. + */ + StorageSyncService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StorageSyncService create(Context context); + } + /** The stage of the StorageSyncService definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Gets or sets a list of key value pairs that describe the resource. These + * tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags + * can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and + * a value with a length no greater than 256 characters.. + * + * @param tags Gets or sets a list of key value pairs that describe the resource. These tags can be used for + * viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for + * a resource. Each tag must have a key with a length no greater than 128 characters and a value with a + * length no greater than 256 characters. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the StorageSyncService definition allowing to specify incomingTrafficPolicy. */ + interface WithIncomingTrafficPolicy { + /** + * Specifies the incomingTrafficPolicy property: Incoming Traffic Policy. + * + * @param incomingTrafficPolicy Incoming Traffic Policy. + * @return the next definition stage. + */ + WithCreate withIncomingTrafficPolicy(IncomingTrafficPolicy incomingTrafficPolicy); + } + } + /** + * Begins update for the StorageSyncService resource. + * + * @return the stage of resource update. + */ + StorageSyncService.Update update(); + + /** The template for StorageSyncService update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIncomingTrafficPolicy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + StorageSyncService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + StorageSyncService apply(Context context); + } + /** The StorageSyncService update stages. */ + interface UpdateStages { + /** The stage of the StorageSyncService update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The user-specified tags associated with the storage sync service.. + * + * @param tags The user-specified tags associated with the storage sync service. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the StorageSyncService update allowing to specify incomingTrafficPolicy. */ + interface WithIncomingTrafficPolicy { + /** + * Specifies the incomingTrafficPolicy property: Incoming Traffic Policy. + * + * @param incomingTrafficPolicy Incoming Traffic Policy. + * @return the next definition stage. + */ + Update withIncomingTrafficPolicy(IncomingTrafficPolicy incomingTrafficPolicy); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StorageSyncService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StorageSyncService refresh(Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServiceArray.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServiceArray.java new file mode 100644 index 0000000000000..3facbed98a357 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServiceArray.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.fluent.models.StorageSyncServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Array of StorageSyncServices. */ +@Fluent +public final class StorageSyncServiceArray { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageSyncServiceArray.class); + + /* + * Collection of StorageSyncServices. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Collection of StorageSyncServices. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of StorageSyncServices. + * + * @param value the value value to set. + * @return the StorageSyncServiceArray object itself. + */ + public StorageSyncServiceArray withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServiceCreateParameters.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServiceCreateParameters.java new file mode 100644 index 0000000000000..b29f8c787fda6 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServiceCreateParameters.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters used when creating a storage sync service. */ +@JsonFlatten +@Fluent +public class StorageSyncServiceCreateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageSyncServiceCreateParameters.class); + + /* + * Required. Gets or sets the location of the resource. This will be one of + * the supported and registered Azure Geo Regions (e.g. West US, East US, + * Southeast Asia, etc.). The geo region of a resource cannot be changed + * once it is created, but if an identical geo region is specified on + * update, the request will succeed. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * Gets or sets a list of key value pairs that describe the resource. These + * tags can be used for viewing and grouping this resource (across resource + * groups). A maximum of 15 tags can be provided for a resource. Each tag + * must have a key with a length no greater than 128 characters and a value + * with a length no greater than 256 characters. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Incoming Traffic Policy + */ + @JsonProperty(value = "properties.incomingTrafficPolicy") + private IncomingTrafficPolicy incomingTrafficPolicy; + + /** + * Get the location property: Required. Gets or sets the location of the resource. This will be one of the supported + * and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource + * cannot be changed once it is created, but if an identical geo region is specified on update, the request will + * succeed. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Required. Gets or sets the location of the resource. This will be one of the supported + * and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource + * cannot be changed once it is created, but if an identical geo region is specified on update, the request will + * succeed. + * + * @param location the location value to set. + * @return the StorageSyncServiceCreateParameters object itself. + */ + public StorageSyncServiceCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: Gets or sets a list of key value pairs that describe the resource. These tags can be used + * for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a + * resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no + * greater than 256 characters. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets a list of key value pairs that describe the resource. These tags can be used + * for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a + * resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no + * greater than 256 characters. + * + * @param tags the tags value to set. + * @return the StorageSyncServiceCreateParameters object itself. + */ + public StorageSyncServiceCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the incomingTrafficPolicy property: Incoming Traffic Policy. + * + * @return the incomingTrafficPolicy value. + */ + public IncomingTrafficPolicy incomingTrafficPolicy() { + return this.incomingTrafficPolicy; + } + + /** + * Set the incomingTrafficPolicy property: Incoming Traffic Policy. + * + * @param incomingTrafficPolicy the incomingTrafficPolicy value to set. + * @return the StorageSyncServiceCreateParameters object itself. + */ + public StorageSyncServiceCreateParameters withIncomingTrafficPolicy(IncomingTrafficPolicy incomingTrafficPolicy) { + this.incomingTrafficPolicy = incomingTrafficPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property location in model StorageSyncServiceCreateParameters")); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServiceUpdateParameters.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServiceUpdateParameters.java new file mode 100644 index 0000000000000..7be0716aedb27 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServiceUpdateParameters.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Parameters for updating an Storage sync service. */ +@JsonFlatten +@Fluent +public class StorageSyncServiceUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageSyncServiceUpdateParameters.class); + + /* + * The user-specified tags associated with the storage sync service. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Incoming Traffic Policy + */ + @JsonProperty(value = "properties.incomingTrafficPolicy") + private IncomingTrafficPolicy incomingTrafficPolicy; + + /** + * Get the tags property: The user-specified tags associated with the storage sync service. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The user-specified tags associated with the storage sync service. + * + * @param tags the tags value to set. + * @return the StorageSyncServiceUpdateParameters object itself. + */ + public StorageSyncServiceUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the incomingTrafficPolicy property: Incoming Traffic Policy. + * + * @return the incomingTrafficPolicy value. + */ + public IncomingTrafficPolicy incomingTrafficPolicy() { + return this.incomingTrafficPolicy; + } + + /** + * Set the incomingTrafficPolicy property: Incoming Traffic Policy. + * + * @param incomingTrafficPolicy the incomingTrafficPolicy value to set. + * @return the StorageSyncServiceUpdateParameters object itself. + */ + public StorageSyncServiceUpdateParameters withIncomingTrafficPolicy(IncomingTrafficPolicy incomingTrafficPolicy) { + this.incomingTrafficPolicy = incomingTrafficPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServices.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServices.java new file mode 100644 index 0000000000000..0bb8f58c14a7a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServices.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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 StorageSyncServices. */ +public interface StorageSyncServices { + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param parameters Parameters to check availability of the given namespace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + CheckNameAvailabilityResult checkNameAvailability(String locationName, CheckNameAvailabilityParameters parameters); + + /** + * Check the give namespace name availability. + * + * @param locationName The desired region for the name check. + * @param parameters Parameters to check availability of the given namespace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the CheckNameAvailability operation response. + */ + Response checkNameAvailabilityWithResponse( + String locationName, CheckNameAvailabilityParameters parameters, Context context); + + /** + * Get a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given StorageSyncService. + */ + StorageSyncService getByResourceGroup(String resourceGroupName, String storageSyncServiceName); + + /** + * Get a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given StorageSyncService. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String storageSyncServiceName, Context context); + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName); + + /** + * Delete a given StorageSyncService. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, Context context); + + /** + * Get a StorageSyncService list by Resource group name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by Resource group name. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get a StorageSyncService list by Resource group name. + * + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by Resource group name. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a StorageSyncService list by subscription. + * + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by subscription. + */ + PagedIterable list(); + + /** + * Get a StorageSyncService list by subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a StorageSyncService list by subscription. + */ + PagedIterable list(Context context); + + /** + * Get a given StorageSyncService. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given StorageSyncService. + */ + StorageSyncService getById(String id); + + /** + * Get a given StorageSyncService. + * + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given StorageSyncService. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a given StorageSyncService. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 given StorageSyncService. + * + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 StorageSyncService resource. + * + * @param name resource name. + * @return the first stage of the new StorageSyncService definition. + */ + StorageSyncService.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesCreateHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesCreateHeaders.java new file mode 100644 index 0000000000000..55c33aa18c395 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesCreateHeaders.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The StorageSyncServicesCreateHeaders model. */ +@Fluent +public final class StorageSyncServicesCreateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageSyncServicesCreateHeaders.class); + + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the StorageSyncServicesCreateHeaders object itself. + */ + public StorageSyncServicesCreateHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the StorageSyncServicesCreateHeaders object itself. + */ + public StorageSyncServicesCreateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the StorageSyncServicesCreateHeaders object itself. + */ + public StorageSyncServicesCreateHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the StorageSyncServicesCreateHeaders object itself. + */ + public StorageSyncServicesCreateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the StorageSyncServicesCreateHeaders object itself. + */ + public StorageSyncServicesCreateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesCreateResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesCreateResponse.java new file mode 100644 index 0000000000000..f9fe7466fe0ec --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesCreateResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.StorageSyncServiceInner; + +/** Contains all response data for the create operation. */ +public final class StorageSyncServicesCreateResponse + extends ResponseBase { + /** + * Creates an instance of StorageSyncServicesCreateResponse. + * + * @param request the request which resulted in this StorageSyncServicesCreateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public StorageSyncServicesCreateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + StorageSyncServiceInner value, + StorageSyncServicesCreateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public StorageSyncServiceInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesDeleteHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesDeleteHeaders.java new file mode 100644 index 0000000000000..648e58830943a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesDeleteHeaders.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The StorageSyncServicesDeleteHeaders model. */ +@Fluent +public final class StorageSyncServicesDeleteHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageSyncServicesDeleteHeaders.class); + + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the StorageSyncServicesDeleteHeaders object itself. + */ + public StorageSyncServicesDeleteHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the StorageSyncServicesDeleteHeaders object itself. + */ + public StorageSyncServicesDeleteHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the StorageSyncServicesDeleteHeaders object itself. + */ + public StorageSyncServicesDeleteHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the StorageSyncServicesDeleteHeaders object itself. + */ + public StorageSyncServicesDeleteHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the StorageSyncServicesDeleteHeaders object itself. + */ + public StorageSyncServicesDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesDeleteResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesDeleteResponse.java new file mode 100644 index 0000000000000..efcceada64465 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesDeleteResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the delete operation. */ +public final class StorageSyncServicesDeleteResponse extends ResponseBase { + /** + * Creates an instance of StorageSyncServicesDeleteResponse. + * + * @param request the request which resulted in this StorageSyncServicesDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public StorageSyncServicesDeleteResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + StorageSyncServicesDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesGetByResourceGroupHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesGetByResourceGroupHeaders.java new file mode 100644 index 0000000000000..52413fe2230eb --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesGetByResourceGroupHeaders.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The StorageSyncServicesGetByResourceGroupHeaders model. */ +@Fluent +public final class StorageSyncServicesGetByResourceGroupHeaders { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(StorageSyncServicesGetByResourceGroupHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the StorageSyncServicesGetByResourceGroupHeaders object itself. + */ + public StorageSyncServicesGetByResourceGroupHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the StorageSyncServicesGetByResourceGroupHeaders object itself. + */ + public StorageSyncServicesGetByResourceGroupHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesGetByResourceGroupResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesGetByResourceGroupResponse.java new file mode 100644 index 0000000000000..1a810ac2b8d29 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesGetByResourceGroupResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.StorageSyncServiceInner; + +/** Contains all response data for the getByResourceGroup operation. */ +public final class StorageSyncServicesGetByResourceGroupResponse + extends ResponseBase { + /** + * Creates an instance of StorageSyncServicesGetByResourceGroupResponse. + * + * @param request the request which resulted in this StorageSyncServicesGetByResourceGroupResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public StorageSyncServicesGetByResourceGroupResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + StorageSyncServiceInner value, + StorageSyncServicesGetByResourceGroupHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public StorageSyncServiceInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListByResourceGroupHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListByResourceGroupHeaders.java new file mode 100644 index 0000000000000..306e322e09255 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListByResourceGroupHeaders.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The StorageSyncServicesListByResourceGroupHeaders model. */ +@Fluent +public final class StorageSyncServicesListByResourceGroupHeaders { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(StorageSyncServicesListByResourceGroupHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the StorageSyncServicesListByResourceGroupHeaders object itself. + */ + public StorageSyncServicesListByResourceGroupHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the StorageSyncServicesListByResourceGroupHeaders object itself. + */ + public StorageSyncServicesListByResourceGroupHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListByResourceGroupResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListByResourceGroupResponse.java new file mode 100644 index 0000000000000..51e0868d1c81a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListByResourceGroupResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the listByResourceGroup operation. */ +public final class StorageSyncServicesListByResourceGroupResponse + extends ResponseBase { + /** + * Creates an instance of StorageSyncServicesListByResourceGroupResponse. + * + * @param request the request which resulted in this StorageSyncServicesListByResourceGroupResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public StorageSyncServicesListByResourceGroupResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + StorageSyncServiceArray value, + StorageSyncServicesListByResourceGroupHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public StorageSyncServiceArray getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListHeaders.java new file mode 100644 index 0000000000000..75cf149c1e6eb --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The StorageSyncServicesListHeaders model. */ +@Fluent +public final class StorageSyncServicesListHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageSyncServicesListHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the StorageSyncServicesListHeaders object itself. + */ + public StorageSyncServicesListHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the StorageSyncServicesListHeaders object itself. + */ + public StorageSyncServicesListHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListResponse.java new file mode 100644 index 0000000000000..a18f5b144e931 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the list operation. */ +public final class StorageSyncServicesListResponse + extends ResponseBase { + /** + * Creates an instance of StorageSyncServicesListResponse. + * + * @param request the request which resulted in this StorageSyncServicesListResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public StorageSyncServicesListResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + StorageSyncServiceArray value, + StorageSyncServicesListHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public StorageSyncServiceArray getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesUpdateHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesUpdateHeaders.java new file mode 100644 index 0000000000000..62da064787029 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesUpdateHeaders.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The StorageSyncServicesUpdateHeaders model. */ +@Fluent +public final class StorageSyncServicesUpdateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageSyncServicesUpdateHeaders.class); + + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the StorageSyncServicesUpdateHeaders object itself. + */ + public StorageSyncServicesUpdateHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the StorageSyncServicesUpdateHeaders object itself. + */ + public StorageSyncServicesUpdateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the StorageSyncServicesUpdateHeaders object itself. + */ + public StorageSyncServicesUpdateHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the StorageSyncServicesUpdateHeaders object itself. + */ + public StorageSyncServicesUpdateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the StorageSyncServicesUpdateHeaders object itself. + */ + public StorageSyncServicesUpdateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesUpdateResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesUpdateResponse.java new file mode 100644 index 0000000000000..3fbdadbb937da --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesUpdateResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.StorageSyncServiceInner; + +/** Contains all response data for the update operation. */ +public final class StorageSyncServicesUpdateResponse + extends ResponseBase { + /** + * Creates an instance of StorageSyncServicesUpdateResponse. + * + * @param request the request which resulted in this StorageSyncServicesUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public StorageSyncServicesUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + StorageSyncServiceInner value, + StorageSyncServicesUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public StorageSyncServiceInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroup.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroup.java new file mode 100644 index 0000000000000..5aca13ca0b1d5 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroup.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.fluent.models.SyncGroupInner; + +/** An immutable client-side representation of SyncGroup. */ +public interface SyncGroup { + /** + * 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 uniqueId property: Unique Id. + * + * @return the uniqueId value. + */ + String uniqueId(); + + /** + * Gets the syncGroupStatus property: Sync group status. + * + * @return the syncGroupStatus value. + */ + String syncGroupStatus(); + + /** + * Gets the inner com.azure.resourcemanager.storagesync.fluent.models.SyncGroupInner object. + * + * @return the inner object. + */ + SyncGroupInner innerModel(); + + /** The entirety of the SyncGroup definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SyncGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the SyncGroup definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SyncGroup definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, storageSyncServiceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @return the next definition stage. + */ + WithCreate withExistingStorageSyncService(String resourceGroupName, String storageSyncServiceName); + } + /** + * The stage of the SyncGroup 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. + */ + SyncGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SyncGroup create(Context context); + } + /** The stage of the SyncGroup definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The parameters used to create the sync group. + * + * @param properties The parameters used to create the sync group. + * @return the next definition stage. + */ + WithCreate withProperties(Object properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SyncGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SyncGroup refresh(Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupArray.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupArray.java new file mode 100644 index 0000000000000..237395ab2968f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupArray.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.fluent.models.SyncGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Array of SyncGroup. */ +@Fluent +public final class SyncGroupArray { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SyncGroupArray.class); + + /* + * Collection of SyncGroup. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Collection of SyncGroup. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of SyncGroup. + * + * @param value the value value to set. + * @return the SyncGroupArray object itself. + */ + public SyncGroupArray withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupCreateParameters.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupCreateParameters.java new file mode 100644 index 0000000000000..21274e963eacd --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupCreateParameters.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used when creating a sync group. */ +@Fluent +public final class SyncGroupCreateParameters extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SyncGroupCreateParameters.class); + + /* + * The parameters used to create the sync group + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get the properties property: The parameters used to create the sync group. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: The parameters used to create the sync group. + * + * @param properties the properties value to set. + * @return the SyncGroupCreateParameters object itself. + */ + public SyncGroupCreateParameters withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroups.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroups.java new file mode 100644 index 0000000000000..21517ff07cab2 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroups.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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 SyncGroups. */ +public interface SyncGroups { + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SyncGroup List. + */ + PagedIterable listByStorageSyncService(String resourceGroupName, String storageSyncServiceName); + + /** + * Get a SyncGroup List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SyncGroup List. + */ + PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context); + + /** + * Get a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given SyncGroup. + */ + SyncGroup get(String resourceGroupName, String storageSyncServiceName, String syncGroupName); + + /** + * Get a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given SyncGroup. + */ + Response getWithResponse( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context); + + /** + * Delete a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 storageSyncServiceName, String syncGroupName); + + /** + * Delete a given SyncGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param syncGroupName Name of Sync Group resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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. + */ + SyncGroupsDeleteResponse deleteWithResponse( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, Context context); + + /** + * Get a given SyncGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given SyncGroup. + */ + SyncGroup getById(String id); + + /** + * Get a given SyncGroup. + * + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a given SyncGroup. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a given SyncGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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 given SyncGroup. + * + * @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.resourcemanager.storagesync.models.StorageSyncApiErrorException 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. + */ + SyncGroupsDeleteResponse deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SyncGroup resource. + * + * @param name resource name. + * @return the first stage of the new SyncGroup definition. + */ + SyncGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsCreateHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsCreateHeaders.java new file mode 100644 index 0000000000000..f6b00ccde3269 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsCreateHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SyncGroupsCreateHeaders model. */ +@Fluent +public final class SyncGroupsCreateHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SyncGroupsCreateHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the SyncGroupsCreateHeaders object itself. + */ + public SyncGroupsCreateHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the SyncGroupsCreateHeaders object itself. + */ + public SyncGroupsCreateHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsCreateResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsCreateResponse.java new file mode 100644 index 0000000000000..3a42ffbd707ce --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsCreateResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.SyncGroupInner; + +/** Contains all response data for the create operation. */ +public final class SyncGroupsCreateResponse extends ResponseBase { + /** + * Creates an instance of SyncGroupsCreateResponse. + * + * @param request the request which resulted in this SyncGroupsCreateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public SyncGroupsCreateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + SyncGroupInner value, + SyncGroupsCreateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public SyncGroupInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsDeleteHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsDeleteHeaders.java new file mode 100644 index 0000000000000..048942bffa29f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsDeleteHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SyncGroupsDeleteHeaders model. */ +@Fluent +public final class SyncGroupsDeleteHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SyncGroupsDeleteHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the SyncGroupsDeleteHeaders object itself. + */ + public SyncGroupsDeleteHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the SyncGroupsDeleteHeaders object itself. + */ + public SyncGroupsDeleteHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsDeleteResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsDeleteResponse.java new file mode 100644 index 0000000000000..53a02fe0a7fbc --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsDeleteResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the delete operation. */ +public final class SyncGroupsDeleteResponse extends ResponseBase { + /** + * Creates an instance of SyncGroupsDeleteResponse. + * + * @param request the request which resulted in this SyncGroupsDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public SyncGroupsDeleteResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, SyncGroupsDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsGetHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsGetHeaders.java new file mode 100644 index 0000000000000..f50c3970578ae --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsGetHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SyncGroupsGetHeaders model. */ +@Fluent +public final class SyncGroupsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SyncGroupsGetHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the SyncGroupsGetHeaders object itself. + */ + public SyncGroupsGetHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the SyncGroupsGetHeaders object itself. + */ + public SyncGroupsGetHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsGetResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsGetResponse.java new file mode 100644 index 0000000000000..8e4fefe234908 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsGetResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.SyncGroupInner; + +/** Contains all response data for the get operation. */ +public final class SyncGroupsGetResponse extends ResponseBase { + /** + * Creates an instance of SyncGroupsGetResponse. + * + * @param request the request which resulted in this SyncGroupsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public SyncGroupsGetResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + SyncGroupInner value, + SyncGroupsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public SyncGroupInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsListByStorageSyncServiceHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsListByStorageSyncServiceHeaders.java new file mode 100644 index 0000000000000..de9282beeaae1 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsListByStorageSyncServiceHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SyncGroupsListByStorageSyncServiceHeaders model. */ +@Fluent +public final class SyncGroupsListByStorageSyncServiceHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SyncGroupsListByStorageSyncServiceHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the SyncGroupsListByStorageSyncServiceHeaders object itself. + */ + public SyncGroupsListByStorageSyncServiceHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the SyncGroupsListByStorageSyncServiceHeaders object itself. + */ + public SyncGroupsListByStorageSyncServiceHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsListByStorageSyncServiceResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsListByStorageSyncServiceResponse.java new file mode 100644 index 0000000000000..daf1d8c21c7a3 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsListByStorageSyncServiceResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the listByStorageSyncService operation. */ +public final class SyncGroupsListByStorageSyncServiceResponse + extends ResponseBase { + /** + * Creates an instance of SyncGroupsListByStorageSyncServiceResponse. + * + * @param request the request which resulted in this SyncGroupsListByStorageSyncServiceResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public SyncGroupsListByStorageSyncServiceResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + SyncGroupArray value, + SyncGroupsListByStorageSyncServiceHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public SyncGroupArray getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/TriggerChangeDetectionParameters.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/TriggerChangeDetectionParameters.java new file mode 100644 index 0000000000000..d0a66c11d9ca5 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/TriggerChangeDetectionParameters.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The parameters used when calling trigger change detection action on cloud endpoint. */ +@Fluent +public final class TriggerChangeDetectionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggerChangeDetectionParameters.class); + + /* + * Relative path to a directory Azure File share for which change detection + * is to be performed. + */ + @JsonProperty(value = "directoryPath") + private String directoryPath; + + /* + * Change Detection Mode. Applies to a directory specified in directoryPath + * parameter. + */ + @JsonProperty(value = "changeDetectionMode") + private ChangeDetectionMode changeDetectionMode; + + /* + * Array of relative paths on the Azure File share to be included in the + * change detection. Can be files and directories. + */ + @JsonProperty(value = "paths") + private List paths; + + /** + * Get the directoryPath property: Relative path to a directory Azure File share for which change detection is to be + * performed. + * + * @return the directoryPath value. + */ + public String directoryPath() { + return this.directoryPath; + } + + /** + * Set the directoryPath property: Relative path to a directory Azure File share for which change detection is to be + * performed. + * + * @param directoryPath the directoryPath value to set. + * @return the TriggerChangeDetectionParameters object itself. + */ + public TriggerChangeDetectionParameters withDirectoryPath(String directoryPath) { + this.directoryPath = directoryPath; + return this; + } + + /** + * Get the changeDetectionMode property: Change Detection Mode. Applies to a directory specified in directoryPath + * parameter. + * + * @return the changeDetectionMode value. + */ + public ChangeDetectionMode changeDetectionMode() { + return this.changeDetectionMode; + } + + /** + * Set the changeDetectionMode property: Change Detection Mode. Applies to a directory specified in directoryPath + * parameter. + * + * @param changeDetectionMode the changeDetectionMode value to set. + * @return the TriggerChangeDetectionParameters object itself. + */ + public TriggerChangeDetectionParameters withChangeDetectionMode(ChangeDetectionMode changeDetectionMode) { + this.changeDetectionMode = changeDetectionMode; + return this; + } + + /** + * Get the paths property: Array of relative paths on the Azure File share to be included in the change detection. + * Can be files and directories. + * + * @return the paths value. + */ + public List paths() { + return this.paths; + } + + /** + * Set the paths property: Array of relative paths on the Azure File share to be included in the change detection. + * Can be files and directories. + * + * @param paths the paths value to set. + * @return the TriggerChangeDetectionParameters object itself. + */ + public TriggerChangeDetectionParameters withPaths(List paths) { + this.paths = paths; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/TriggerRolloverRequest.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/TriggerRolloverRequest.java new file mode 100644 index 0000000000000..e77dfdcf8d284 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/TriggerRolloverRequest.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trigger Rollover Request. */ +@Fluent +public final class TriggerRolloverRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggerRolloverRequest.class); + + /* + * Certificate Data + */ + @JsonProperty(value = "serverCertificate") + private String serverCertificate; + + /** + * Get the serverCertificate property: Certificate Data. + * + * @return the serverCertificate value. + */ + public String serverCertificate() { + return this.serverCertificate; + } + + /** + * Set the serverCertificate property: Certificate Data. + * + * @param serverCertificate the serverCertificate value to set. + * @return the TriggerRolloverRequest object itself. + */ + public TriggerRolloverRequest withServerCertificate(String serverCertificate) { + this.serverCertificate = serverCertificate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Workflow.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Workflow.java new file mode 100644 index 0000000000000..39dc18774d77e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Workflow.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.resourcemanager.storagesync.fluent.models.WorkflowInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of Workflow. */ +public interface Workflow { + /** + * 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 lastStepName property: last step name. + * + * @return the lastStepName value. + */ + String lastStepName(); + + /** + * Gets the status property: workflow status. + * + * @return the status value. + */ + WorkflowStatus status(); + + /** + * Gets the operation property: operation direction. + * + * @return the operation value. + */ + OperationDirection operation(); + + /** + * Gets the steps property: workflow steps. + * + * @return the steps value. + */ + String steps(); + + /** + * Gets the lastOperationId property: workflow last operation identifier. + * + * @return the lastOperationId value. + */ + String lastOperationId(); + + /** + * Gets the commandName property: workflow command name. + * + * @return the commandName value. + */ + String commandName(); + + /** + * Gets the createdTimestamp property: workflow created timestamp. + * + * @return the createdTimestamp value. + */ + OffsetDateTime createdTimestamp(); + + /** + * Gets the lastStatusTimestamp property: workflow last status timestamp. + * + * @return the lastStatusTimestamp value. + */ + OffsetDateTime lastStatusTimestamp(); + + /** + * Gets the inner com.azure.resourcemanager.storagesync.fluent.models.WorkflowInner object. + * + * @return the inner object. + */ + WorkflowInner innerModel(); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowArray.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowArray.java new file mode 100644 index 0000000000000..2e2f1e2bff92f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowArray.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.fluent.models.WorkflowInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Array of Workflow. */ +@Fluent +public final class WorkflowArray { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkflowArray.class); + + /* + * Collection of workflow items. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Collection of workflow items. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of workflow items. + * + * @param value the value value to set. + * @return the WorkflowArray object itself. + */ + public WorkflowArray withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowStatus.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowStatus.java new file mode 100644 index 0000000000000..c4191b4aa81d7 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowStatus.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WorkflowStatus. */ +public final class WorkflowStatus extends ExpandableStringEnum { + /** Static value active for WorkflowStatus. */ + public static final WorkflowStatus ACTIVE = fromString("active"); + + /** Static value expired for WorkflowStatus. */ + public static final WorkflowStatus EXPIRED = fromString("expired"); + + /** Static value succeeded for WorkflowStatus. */ + public static final WorkflowStatus SUCCEEDED = fromString("succeeded"); + + /** Static value aborted for WorkflowStatus. */ + public static final WorkflowStatus ABORTED = fromString("aborted"); + + /** Static value failed for WorkflowStatus. */ + public static final WorkflowStatus FAILED = fromString("failed"); + + /** + * Creates or finds a WorkflowStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkflowStatus. + */ + @JsonCreator + public static WorkflowStatus fromString(String name) { + return fromString(name, WorkflowStatus.class); + } + + /** @return known WorkflowStatus values. */ + public static Collection values() { + return values(WorkflowStatus.class); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Workflows.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Workflows.java new file mode 100644 index 0000000000000..9ea69e23af7f3 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Workflows.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.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 Workflows. */ +public interface Workflows { + /** + * Get a Workflow List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workflow List. + */ + PagedIterable listByStorageSyncService(String resourceGroupName, String storageSyncServiceName); + + /** + * Get a Workflow List. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Workflow List. + */ + PagedIterable listByStorageSyncService( + String resourceGroupName, String storageSyncServiceName, Context context); + + /** + * Get Workflows resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflows resource. + */ + Workflow get(String resourceGroupName, String storageSyncServiceName, String workflowId); + + /** + * Get Workflows resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workflows resource. + */ + Response getWithResponse( + String resourceGroupName, String storageSyncServiceName, String workflowId, Context context); + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException thrown if the request is + * rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void abort(String resourceGroupName, String storageSyncServiceName, String workflowId); + + /** + * Abort the given workflow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param storageSyncServiceName Name of Storage Sync Service resource. + * @param workflowId workflow Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.storagesync.models.StorageSyncApiErrorException 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. + */ + WorkflowsAbortResponse abortWithResponse( + String resourceGroupName, String storageSyncServiceName, String workflowId, Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsAbortHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsAbortHeaders.java new file mode 100644 index 0000000000000..c87a14c6556bd --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsAbortHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The WorkflowsAbortHeaders model. */ +@Fluent +public final class WorkflowsAbortHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkflowsAbortHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the WorkflowsAbortHeaders object itself. + */ + public WorkflowsAbortHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the WorkflowsAbortHeaders object itself. + */ + public WorkflowsAbortHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsAbortResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsAbortResponse.java new file mode 100644 index 0000000000000..f6a2e2639619e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsAbortResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the abort operation. */ +public final class WorkflowsAbortResponse extends ResponseBase { + /** + * Creates an instance of WorkflowsAbortResponse. + * + * @param request the request which resulted in this WorkflowsAbortResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public WorkflowsAbortResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, WorkflowsAbortHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsGetHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsGetHeaders.java new file mode 100644 index 0000000000000..47bf8bec4da01 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsGetHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The WorkflowsGetHeaders model. */ +@Fluent +public final class WorkflowsGetHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkflowsGetHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the WorkflowsGetHeaders object itself. + */ + public WorkflowsGetHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the WorkflowsGetHeaders object itself. + */ + public WorkflowsGetHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsGetResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsGetResponse.java new file mode 100644 index 0000000000000..328d57bf05159 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsGetResponse.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.storagesync.fluent.models.WorkflowInner; + +/** Contains all response data for the get operation. */ +public final class WorkflowsGetResponse extends ResponseBase { + /** + * Creates an instance of WorkflowsGetResponse. + * + * @param request the request which resulted in this WorkflowsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public WorkflowsGetResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, WorkflowInner value, WorkflowsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public WorkflowInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsListByStorageSyncServiceHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsListByStorageSyncServiceHeaders.java new file mode 100644 index 0000000000000..418e20adab868 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsListByStorageSyncServiceHeaders.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The WorkflowsListByStorageSyncServiceHeaders model. */ +@Fluent +public final class WorkflowsListByStorageSyncServiceHeaders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkflowsListByStorageSyncServiceHeaders.class); + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-correlation-request-id property. + */ + @JsonProperty(value = "x-ms-correlation-request-id") + private String xMsCorrelationRequestId; + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String xMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the WorkflowsListByStorageSyncServiceHeaders object itself. + */ + public WorkflowsListByStorageSyncServiceHeaders withXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @return the xMsCorrelationRequestId value. + */ + public String xMsCorrelationRequestId() { + return this.xMsCorrelationRequestId; + } + + /** + * Set the xMsCorrelationRequestId property: The x-ms-correlation-request-id property. + * + * @param xMsCorrelationRequestId the xMsCorrelationRequestId value to set. + * @return the WorkflowsListByStorageSyncServiceHeaders object itself. + */ + public WorkflowsListByStorageSyncServiceHeaders withXMsCorrelationRequestId(String xMsCorrelationRequestId) { + this.xMsCorrelationRequestId = xMsCorrelationRequestId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsListByStorageSyncServiceResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsListByStorageSyncServiceResponse.java new file mode 100644 index 0000000000000..06e992ac8cdd9 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsListByStorageSyncServiceResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the listByStorageSyncService operation. */ +public final class WorkflowsListByStorageSyncServiceResponse + extends ResponseBase { + /** + * Creates an instance of WorkflowsListByStorageSyncServiceResponse. + * + * @param request the request which resulted in this WorkflowsListByStorageSyncServiceResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public WorkflowsListByStorageSyncServiceResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + WorkflowArray value, + WorkflowsListByStorageSyncServiceHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public WorkflowArray getValue() { + return super.getValue(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/package-info.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/package-info.java new file mode 100644 index 0000000000000..f4de4c97afafe --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for MicrosoftStorageSync. Microsoft Storage Sync Service API. */ +package com.azure.resourcemanager.storagesync.models; diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/package-info.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/package-info.java new file mode 100644 index 0000000000000..6a375301c35e8 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for MicrosoftStorageSync. Microsoft Storage Sync Service API. */ +package com.azure.resourcemanager.storagesync; diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/module-info.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/module-info.java new file mode 100644 index 0000000000000..66d97f878d9b5 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.storagesync { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.storagesync; + exports com.azure.resourcemanager.storagesync.fluent; + exports com.azure.resourcemanager.storagesync.fluent.models; + exports com.azure.resourcemanager.storagesync.models; + + opens com.azure.resourcemanager.storagesync.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.storagesync.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/storagesync/ci.yml b/sdk/storagesync/ci.yml new file mode 100644 index 0000000000000..4aab2d76d3d8c --- /dev/null +++ b/sdk/storagesync/ci.yml @@ -0,0 +1,33 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + paths: + include: + - sdk/storagesync/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagesync/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: storagesync + Artifacts: + - name: azure-resourcemanager-storagesync + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerstoragesync diff --git a/sdk/storagesync/pom.xml b/sdk/storagesync/pom.xml new file mode 100644 index 0000000000000..5850dcab4f90e --- /dev/null +++ b/sdk/storagesync/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-storagesync-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-storagesync + + + +