From 71837c6eca7a463a74bd238fe260772ddbc8a817 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 7 Sep 2022 18:32:06 +0000 Subject: [PATCH] CodeGen from PR 20227 in Azure/azure-rest-api-specs Merge c42b5d1b0178748f04c885e3b9f307c0668aaec4 into 374bebd0b0764ba8350cb186e010f1fee987d0b7 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 102 + .../SAMPLE.md | 1348 +++++++ .../azure-resourcemanager-storagesync/pom.xml | 55 + .../storagesync/StoragesyncManager.java | 444 +++ .../fluent/CloudEndpointsClient.java | 799 ++++ .../fluent/MicrosoftStorageSync.java | 123 + .../OperationStatusOperationsClient.java | 48 + .../storagesync/fluent/OperationsClient.java | 38 + .../PrivateEndpointConnectionsClient.java | 239 ++ .../fluent/PrivateLinkResourcesClient.java | 44 + .../fluent/RegisteredServersClient.java | 304 ++ .../fluent/ResourceProvidersClient.java | 44 + .../fluent/ServerEndpointsClient.java | 459 +++ .../fluent/StorageSyncServicesClient.java | 347 ++ .../storagesync/fluent/SyncGroupsClient.java | 153 + .../storagesync/fluent/WorkflowsClient.java | 109 + .../CheckNameAvailabilityResultInner.java | 70 + ...areMetadataCertificatePublicKeysInner.java | 50 + ...oudEndpointCreateParametersProperties.java | 124 + .../fluent/models/CloudEndpointInner.java | 258 ++ .../models/CloudEndpointProperties.java | 262 ++ .../models/LocationOperationStatusInner.java | 130 + .../fluent/models/OperationEntityInner.java | 132 + .../fluent/models/OperationStatusInner.java | 100 + .../models/PostBackupResponseInner.java | 47 + .../models/PostBackupResponseProperties.java | 35 + .../PrivateEndpointConnectionInner.java | 116 + .../PrivateEndpointConnectionProperties.java | 108 + .../PrivateLinkResourceListResultInner.java | 51 + .../models/PrivateLinkResourceProperties.java | 77 + ...teredServerCreateParametersProperties.java | 254 ++ .../fluent/models/RegisteredServerInner.java | 544 +++ .../models/RegisteredServerProperties.java | 587 +++ ...verEndpointCreateParametersProperties.java | 315 ++ .../fluent/models/ServerEndpointInner.java | 402 ++ .../models/ServerEndpointProperties.java | 460 +++ .../ServerEndpointUpdateProperties.java | 181 + ...SyncServiceCreateParametersProperties.java | 48 + .../models/StorageSyncServiceInner.java | 134 + .../models/StorageSyncServiceProperties.java | 142 + .../StorageSyncServiceUpdateProperties.java | 47 + .../fluent/models/SyncGroupInner.java | 57 + .../fluent/models/SyncGroupProperties.java | 50 + .../fluent/models/WorkflowInner.java | 200 + .../fluent/models/WorkflowProperties.java | 198 + .../fluent/models/package-info.java | 6 + .../storagesync/fluent/package-info.java | 6 + .../CheckNameAvailabilityResultImpl.java | 42 + ...hareMetadataCertificatePublicKeysImpl.java | 38 + .../implementation/CloudEndpointImpl.java | 269 ++ .../CloudEndpointsClientImpl.java | 3519 +++++++++++++++++ .../implementation/CloudEndpointsImpl.java | 450 +++ .../LocationOperationStatusImpl.java | 59 + .../MicrosoftStorageSyncBuilder.java | 144 + .../MicrosoftStorageSyncImpl.java | 430 ++ .../implementation/OperationEntityImpl.java | 46 + .../implementation/OperationStatusImpl.java | 50 + .../OperationStatusOperationsClientImpl.java | 243 ++ .../OperationStatusOperationsImpl.java | 62 + .../implementation/OperationsClientImpl.java | 272 ++ .../implementation/OperationsImpl.java | 45 + .../PostBackupResponseImpl.java | 32 + .../PrivateEndpointConnectionImpl.java | 142 + .../PrivateEndpointConnectionsClientImpl.java | 1152 ++++++ .../PrivateEndpointConnectionsImpl.java | 225 ++ .../PrivateLinkResourceListResultImpl.java | 41 + .../PrivateLinkResourcesClientImpl.java | 222 ++ .../PrivateLinkResourcesImpl.java | 65 + .../implementation/RegisteredServerImpl.java | 259 ++ .../RegisteredServersClientImpl.java | 1382 +++++++ .../implementation/RegisteredServersImpl.java | 223 ++ .../ResourceProvidersClientImpl.java | 209 + .../implementation/ResourceProvidersImpl.java | 61 + .../implementation/ServerEndpointImpl.java | 359 ++ .../ServerEndpointsClientImpl.java | 1996 ++++++++++ .../implementation/ServerEndpointsImpl.java | 276 ++ .../StorageSyncServiceImpl.java | 232 ++ .../StorageSyncServicesClientImpl.java | 1621 ++++++++ .../StorageSyncServicesImpl.java | 209 + .../implementation/SyncGroupImpl.java | 116 + .../implementation/SyncGroupsClientImpl.java | 827 ++++ .../implementation/SyncGroupsImpl.java | 203 + .../storagesync/implementation/Utils.java | 204 + .../implementation/WorkflowImpl.java | 79 + .../implementation/WorkflowsClientImpl.java | 609 +++ .../implementation/WorkflowsImpl.java | 85 + .../implementation/package-info.java | 6 + .../storagesync/models/BackupRequest.java | 46 + .../models/ChangeDetectionMode.java | 38 + .../CheckNameAvailabilityParameters.java | 86 + .../models/CheckNameAvailabilityResult.java | 40 + .../storagesync/models/CloudEndpoint.java | 359 ++ ...AfsShareMetadataCertificatePublicKeys.java | 33 + .../models/CloudEndpointArray.java | 51 + ...loudEndpointChangeEnumerationActivity.java | 218 + ...ndpointChangeEnumerationActivityState.java | 41 + .../CloudEndpointChangeEnumerationStatus.java | 72 + ...ointChangeEnumerationTotalCountsState.java | 39 + .../models/CloudEndpointCreateParameters.java | 148 + ...udEndpointLastChangeEnumerationStatus.java | 111 + .../storagesync/models/CloudEndpoints.java | 458 +++ ...eMetadataCertificatePublicKeysHeaders.java | 85 + ...MetadataCertificatePublicKeysResponse.java | 44 + .../models/CloudEndpointsGetHeaders.java | 84 + .../models/CloudEndpointsGetResponse.java | 41 + .../CloudEndpointsListBySyncGroupHeaders.java | 84 + ...CloudEndpointsListBySyncGroupResponse.java | 41 + ...CloudEndpointsRestoreheartbeatHeaders.java | 84 + ...loudEndpointsRestoreheartbeatResponse.java | 31 + .../models/CloudTieringCachePerformance.java | 82 + .../models/CloudTieringDatePolicyStatus.java | 51 + .../models/CloudTieringFilesNotTiering.java | 70 + .../models/CloudTieringLowDiskMode.java | 51 + .../models/CloudTieringLowDiskModeState.java | 38 + .../models/CloudTieringSpaceSavings.java | 111 + ...oudTieringVolumeFreeSpacePolicyStatus.java | 67 + .../storagesync/models/FeatureStatus.java | 38 + .../models/FilesNotTieringError.java | 50 + .../models/IncomingTrafficPolicy.java | 38 + .../models/InitialDownloadPolicy.java | 41 + .../models/InitialUploadPolicy.java | 38 + .../storagesync/models/LocalCacheMode.java | 41 + .../models/LocationOperationStatus.java | 67 + .../models/NameAvailabilityReason.java | 54 + .../models/OperationDirection.java | 41 + .../models/OperationDisplayInfo.java | 124 + .../storagesync/models/OperationEntity.java | 45 + .../models/OperationEntityListResult.java | 77 + .../models/OperationProperties.java | 49 + .../OperationResourceMetricSpecification.java | 233 ++ ...nResourceMetricSpecificationDimension.java | 98 + ...OperationResourceServiceSpecification.java | 51 + .../storagesync/models/OperationStatus.java | 53 + .../models/OperationStatusOperations.java | 43 + .../OperationStatusOperationsGetHeaders.java | 84 + .../OperationStatusOperationsGetResponse.java | 42 + .../storagesync/models/Operations.java | 33 + .../models/OperationsListHeaders.java | 84 + .../models/OperationsListNextHeaders.java | 84 + .../models/OperationsListNextResponse.java | 41 + .../models/OperationsListResponse.java | 40 + .../models/PostBackupResponse.java | 24 + .../models/PostRestoreRequest.java | 232 ++ .../storagesync/models/PreRestoreRequest.java | 261 ++ .../storagesync/models/PrivateEndpoint.java | 35 + .../models/PrivateEndpointConnection.java | 152 + .../PrivateEndpointConnectionListResult.java | 51 + ...teEndpointConnectionProvisioningState.java | 45 + .../models/PrivateEndpointConnections.java | 163 + ...ctionsListByStorageSyncServiceHeaders.java | 85 + ...tionsListByStorageSyncServiceResponse.java | 42 + ...rivateEndpointServiceConnectionStatus.java | 42 + .../models/PrivateLinkResource.java | 98 + .../models/PrivateLinkResourceListResult.java | 25 + .../models/PrivateLinkResources.java | 38 + .../PrivateLinkServiceConnectionState.java | 102 + .../models/RecallActionParameters.java | 72 + .../storagesync/models/RegisteredServer.java | 387 ++ .../RegisteredServerAgentVersionStatus.java | 44 + .../models/RegisteredServerArray.java | 51 + .../RegisteredServerCreateParameters.java | 263 ++ .../storagesync/models/RegisteredServers.java | 188 + .../models/RegisteredServersGetHeaders.java | 84 + .../models/RegisteredServersGetResponse.java | 42 + ...erversListByStorageSyncServiceHeaders.java | 85 + ...rversListByStorageSyncServiceResponse.java | 41 + .../storagesync/models/ResourceProviders.java | 39 + ...ovidersLocationOperationStatusHeaders.java | 84 + ...vidersLocationOperationStatusResponse.java | 42 + .../storagesync/models/RestoreFileSpec.java | 72 + .../storagesync/models/ServerEndpoint.java | 497 +++ .../models/ServerEndpointArray.java | 51 + ...ndpointBackgroundDataDownloadActivity.java | 81 + .../ServerEndpointCloudTieringStatus.java | 204 + .../ServerEndpointCreateParameters.java | 311 ++ .../ServerEndpointFilesNotSyncingError.java | 65 + .../models/ServerEndpointHealthState.java | 41 + ...erverEndpointOfflineDataTransferState.java | 45 + .../models/ServerEndpointRecallError.java | 50 + .../models/ServerEndpointRecallStatus.java | 70 + .../ServerEndpointSyncActivityState.java | 41 + .../ServerEndpointSyncActivityStatus.java | 141 + .../models/ServerEndpointSyncMode.java | 47 + .../ServerEndpointSyncSessionStatus.java | 145 + .../models/ServerEndpointSyncStatus.java | 217 + .../ServerEndpointUpdateParameters.java | 179 + .../storagesync/models/ServerEndpoints.java | 213 + .../models/ServerEndpointsGetHeaders.java | 84 + .../models/ServerEndpointsGetResponse.java | 41 + ...ServerEndpointsListBySyncGroupHeaders.java | 111 + ...erverEndpointsListBySyncGroupResponse.java | 41 + .../models/StorageSyncApiError.java | 39 + .../models/StorageSyncApiErrorException.java | 38 + .../models/StorageSyncInnerErrorDetails.java | 124 + .../models/StorageSyncService.java | 282 ++ .../models/StorageSyncServiceArray.java | 51 + .../StorageSyncServiceCreateParameters.java | 143 + .../StorageSyncServiceUpdateParameters.java | 91 + .../models/StorageSyncServices.java | 194 + ...SyncServicesGetByResourceGroupHeaders.java | 84 + ...yncServicesGetByResourceGroupResponse.java | 42 + ...yncServicesListByResourceGroupHeaders.java | 84 + ...ncServicesListByResourceGroupResponse.java | 41 + .../StorageSyncServicesListHeaders.java | 84 + .../StorageSyncServicesListResponse.java | 41 + .../storagesync/models/SyncGroup.java | 119 + .../storagesync/models/SyncGroupArray.java | 51 + .../models/SyncGroupCreateParameters.java | 63 + .../storagesync/models/SyncGroups.java | 156 + .../models/SyncGroupsCreateHeaders.java | 84 + .../models/SyncGroupsCreateResponse.java | 41 + .../models/SyncGroupsDeleteHeaders.java | 84 + .../models/SyncGroupsDeleteResponse.java | 26 + .../models/SyncGroupsGetHeaders.java | 84 + .../models/SyncGroupsGetResponse.java | 41 + ...GroupsListByStorageSyncServiceHeaders.java | 84 + ...roupsListByStorageSyncServiceResponse.java | 41 + .../TriggerChangeDetectionParameters.java | 106 + .../models/TriggerRolloverRequest.java | 46 + .../storagesync/models/Workflow.java | 103 + .../storagesync/models/WorkflowArray.java | 51 + .../storagesync/models/WorkflowStatus.java | 47 + .../storagesync/models/Workflows.java | 99 + .../models/WorkflowsAbortHeaders.java | 84 + .../models/WorkflowsAbortResponse.java | 26 + .../models/WorkflowsGetHeaders.java | 84 + .../models/WorkflowsGetResponse.java | 37 + ...kflowsListByStorageSyncServiceHeaders.java | 84 + ...flowsListByStorageSyncServiceResponse.java | 41 + .../storagesync/models/package-info.java | 6 + .../storagesync/package-info.java | 6 + .../src/main/java/module-info.java | 19 + ...eMetadataCertificatePublicKeysSamples.java | 30 + .../CloudEndpointsCreateSamples.java | 29 + .../CloudEndpointsDeleteSamples.java | 29 + .../generated/CloudEndpointsGetSamples.java | 29 + .../CloudEndpointsListBySyncGroupSamples.java | 24 + .../CloudEndpointsPostBackupSamples.java | 32 + .../CloudEndpointsPostRestoreSamples.java | 45 + .../CloudEndpointsPreBackupSamples.java | 32 + .../CloudEndpointsPreRestoreSamples.java | 42 + ...CloudEndpointsRestoreheartbeatSamples.java | 30 + ...ndpointsTriggerChangeDetectionSamples.java | 35 + .../OperationStatusOperationGetSamples.java | 29 + .../generated/OperationsListSamples.java | 22 + ...ivateEndpointConnectionsCreateSamples.java | 32 + ...ivateEndpointConnectionsDeleteSamples.java | 25 + .../PrivateEndpointConnectionsGetSamples.java | 24 + ...ctionsListByStorageSyncServiceSamples.java | 23 + ...ourcesListByStorageSyncServiceSamples.java | 22 + .../RegisteredServersCreateSamples.java | 31 + .../RegisteredServersDeleteSamples.java | 28 + .../RegisteredServersGetSamples.java | 28 + ...erversListByStorageSyncServiceSamples.java | 25 + ...gisteredServersTriggerRolloverSamples.java | 33 + ...roviderLocationOperationStatusSamples.java | 27 + .../ServerEndpointsCreateSamples.java | 40 + .../ServerEndpointsDeleteSamples.java | 29 + .../generated/ServerEndpointsGetSamples.java | 29 + ...ServerEndpointsListBySyncGroupSamples.java | 25 + .../ServerEndpointsRecallActionSamples.java | 31 + .../ServerEndpointsUpdateSamples.java | 42 + ...cServicesCheckNameAvailabilitySamples.java | 43 + .../StorageSyncServicesCreateSamples.java | 42 + .../StorageSyncServicesDeleteSamples.java | 22 + ...SyncServicesGetByResourceGroupSamples.java | 24 + ...yncServicesListByResourceGroupSamples.java | 23 + .../StorageSyncServicesListSamples.java | 23 + .../StorageSyncServicesUpdateSamples.java | 46 + .../generated/SyncGroupsCreateSamples.java | 33 + .../generated/SyncGroupsDeleteSamples.java | 25 + .../generated/SyncGroupsGetSamples.java | 24 + ...GroupsListByStorageSyncServiceSamples.java | 25 + .../generated/WorkflowsAbortSamples.java | 28 + .../generated/WorkflowsGetSamples.java | 28 + ...kflowsListByStorageSyncServiceSamples.java | 25 + sdk/storagesync/ci.yml | 47 + sdk/storagesync/pom.xml | 15 + 281 files changed, 40641 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/SAMPLE.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/ResourceProvidersClient.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/CloudEndpointAfsShareMetadataCertificatePublicKeysInner.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CloudEndpointCreateParametersProperties.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/CloudEndpointProperties.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/LocationOperationStatusInner.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/PostBackupResponseProperties.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/PrivateEndpointConnectionProperties.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/PrivateLinkResourceProperties.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/RegisteredServerCreateParametersProperties.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/RegisteredServerProperties.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/ServerEndpointCreateParametersProperties.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/ServerEndpointProperties.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/ServerEndpointUpdateProperties.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/StorageSyncServiceCreateParametersProperties.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/StorageSyncServiceProperties.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/StorageSyncServiceUpdateProperties.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/SyncGroupProperties.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/WorkflowProperties.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/CloudEndpointAfsShareMetadataCertificatePublicKeysImpl.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/LocationOperationStatusImpl.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/ResourceProvidersClientImpl.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ResourceProvidersImpl.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/CloudEndpointAfsShareMetadataCertificatePublicKeys.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/CloudEndpointsAfsShareMetadataCertificatePublicKeysHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsAfsShareMetadataCertificatePublicKeysResponse.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/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/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/CloudTieringLowDiskMode.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringLowDiskModeState.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/LocationOperationStatus.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/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/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/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/ResourceProviders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ResourceProvidersLocationOperationStatusHeaders.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ResourceProvidersLocationOperationStatusResponse.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/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/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/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/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/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsAfsShareMetadataCertificatePublicKeysSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsCreateSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsDeleteSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsGetSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsListBySyncGroupSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPostBackupSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPostRestoreSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPreBackupSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPreRestoreSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsRestoreheartbeatSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsTriggerChangeDetectionSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/OperationStatusOperationGetSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/OperationsListSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsCreateSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsListByStorageSyncServiceSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateLinkResourcesListByStorageSyncServiceSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersCreateSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersDeleteSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersGetSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersListByStorageSyncServiceSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersTriggerRolloverSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ResourceProviderLocationOperationStatusSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsCreateSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsDeleteSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsGetSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsListBySyncGroupSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsRecallActionSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsUpdateSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesCheckNameAvailabilitySamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesCreateSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesDeleteSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesGetByResourceGroupSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesListByResourceGroupSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesListSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesUpdateSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsCreateSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsDeleteSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsGetSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsListByStorageSyncServiceSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/WorkflowsAbortSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/WorkflowsGetSamples.java create mode 100644 sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/WorkflowsListByStorageSyncServiceSamples.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 f23745d38c0bc..6d0e21d0e9681 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -373,6 +373,7 @@ com.azure.resourcemanager:azure-resourcemanager-connectedvmware;1.0.0-beta.1;1.0 com.azure.resourcemanager:azure-resourcemanager-alertsmanagement;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-nginx;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-agrifood;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-storagesync;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 0dceda86fc1cb..ab24e016ab13e 100644 --- a/pom.xml +++ b/pom.xml @@ -156,6 +156,7 @@ sdk/storagecache sdk/storageimportexport sdk/storagepool + 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..635dbb53110ca --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-09-07) + +- 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-2022-06-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..047dd82df86ea --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/README.md @@ -0,0 +1,102 @@ +# 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-2022-06-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-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 + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storagesync/azure-resourcemanager-storagesync/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/SAMPLE.md b/sdk/storagesync/azure-resourcemanager-storagesync/SAMPLE.md new file mode 100644 index 0000000000000..3b63245cac346 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/SAMPLE.md @@ -0,0 +1,1348 @@ +# Code snippets and samples + + +## CloudEndpoints + +- [AfsShareMetadataCertificatePublicKeys](#cloudendpoints_afssharemetadatacertificatepublickeys) +- [Create](#cloudendpoints_create) +- [Delete](#cloudendpoints_delete) +- [Get](#cloudendpoints_get) +- [ListBySyncGroup](#cloudendpoints_listbysyncgroup) +- [PostBackup](#cloudendpoints_postbackup) +- [PostRestore](#cloudendpoints_postrestore) +- [PreBackup](#cloudendpoints_prebackup) +- [PreRestore](#cloudendpoints_prerestore) +- [Restoreheartbeat](#cloudendpoints_restoreheartbeat) +- [TriggerChangeDetection](#cloudendpoints_triggerchangedetection) + +## OperationStatusOperation + +- [Get](#operationstatusoperation_get) + +## Operations + +- [List](#operations_list) + +## PrivateEndpointConnections + +- [Create](#privateendpointconnections_create) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [ListByStorageSyncService](#privateendpointconnections_listbystoragesyncservice) + +## PrivateLinkResources + +- [ListByStorageSyncService](#privatelinkresources_listbystoragesyncservice) + +## RegisteredServers + +- [Create](#registeredservers_create) +- [Delete](#registeredservers_delete) +- [Get](#registeredservers_get) +- [ListByStorageSyncService](#registeredservers_listbystoragesyncservice) +- [TriggerRollover](#registeredservers_triggerrollover) + +## ResourceProvider + +- [LocationOperationStatus](#resourceprovider_locationoperationstatus) + +## ServerEndpoints + +- [Create](#serverendpoints_create) +- [Delete](#serverendpoints_delete) +- [Get](#serverendpoints_get) +- [ListBySyncGroup](#serverendpoints_listbysyncgroup) +- [RecallAction](#serverendpoints_recallaction) +- [Update](#serverendpoints_update) + +## StorageSyncServices + +- [CheckNameAvailability](#storagesyncservices_checknameavailability) +- [Create](#storagesyncservices_create) +- [Delete](#storagesyncservices_delete) +- [GetByResourceGroup](#storagesyncservices_getbyresourcegroup) +- [List](#storagesyncservices_list) +- [ListByResourceGroup](#storagesyncservices_listbyresourcegroup) +- [Update](#storagesyncservices_update) + +## SyncGroups + +- [Create](#syncgroups_create) +- [Delete](#syncgroups_delete) +- [Get](#syncgroups_get) +- [ListByStorageSyncService](#syncgroups_listbystoragesyncservice) + +## Workflows + +- [Abort](#workflows_abort) +- [Get](#workflows_get) +- [ListByStorageSyncService](#workflows_listbystoragesyncservice) +### CloudEndpoints_AfsShareMetadataCertificatePublicKeys + +```java +import com.azure.core.util.Context; + +/** Samples for CloudEndpoints AfsShareMetadataCertificatePublicKeys. */ +public final class CloudEndpointsAfsShareMetadataCertificatePublicKeysSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_AfsShareMetadataCertificatePublicKeys.json + */ + /** + * Sample code: CloudEndpoints_AfsShareMetadataCertificatePublicKeys. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsAfsShareMetadataCertificatePublicKeys( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .afsShareMetadataCertificatePublicKeysWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + Context.NONE); + } +} +``` + +### CloudEndpoints_Create + +```java +/** Samples for CloudEndpoints Create. */ +public final class CloudEndpointsCreateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_Create.json + */ + /** + * Sample code: CloudEndpoints_Create. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsCreate(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .define("SampleCloudEndpoint_1") + .withExistingSyncGroup("SampleResourceGroup_1", "SampleStorageSyncService_1", "SampleSyncGroup_1") + .withStorageAccountResourceId( + "/subscriptions/744f4d70-6d17-4921-8970-a765d14f763f/resourceGroups/tminienv59svc/providers/Microsoft.Storage/storageAccounts/tminienv59storage") + .withAzureFileShareName("cvcloud-afscv-0719-058-a94a1354-a1fd-4e9a-9a50-919fad8c4ba4") + .withStorageAccountTenantId("\"72f988bf-86f1-41af-91ab-2d7cd011db47\"") + .withFriendlyName("ankushbsubscriptionmgmtmab") + .create(); + } +} +``` + +### CloudEndpoints_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for CloudEndpoints Delete. */ +public final class CloudEndpointsDeleteSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_Delete.json + */ + /** + * Sample code: CloudEndpoints_Delete. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsDelete(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .delete( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + Context.NONE); + } +} +``` + +### CloudEndpoints_Get + +```java +import com.azure.core.util.Context; + +/** Samples for CloudEndpoints Get. */ +public final class CloudEndpointsGetSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_Get.json + */ + /** + * Sample code: CloudEndpoints_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .getWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + Context.NONE); + } +} +``` + +### CloudEndpoints_ListBySyncGroup + +```java +import com.azure.core.util.Context; + +/** Samples for CloudEndpoints ListBySyncGroup. */ +public final class CloudEndpointsListBySyncGroupSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_ListBySyncGroup.json + */ + /** + * Sample code: CloudEndpoints_ListBySyncGroup. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsListBySyncGroup(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .listBySyncGroup("SampleResourceGroup_1", "SampleStorageSyncService_1", "SampleSyncGroup_1", Context.NONE); + } +} +``` + +### CloudEndpoints_PostBackup + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.BackupRequest; + +/** Samples for CloudEndpoints PostBackup. */ +public final class CloudEndpointsPostBackupSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_PostBackup.json + */ + /** + * Sample code: CloudEndpoints_PostBackup. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsPostBackup(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .postBackup( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + new BackupRequest() + .withAzureFileShare("https://sampleserver.file.core.test-cint.azure-test.net/sampleFileShare"), + Context.NONE); + } +} +``` + +### CloudEndpoints_PostRestore + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.PostRestoreRequest; +import com.azure.resourcemanager.storagesync.models.RestoreFileSpec; +import java.util.Arrays; + +/** Samples for CloudEndpoints PostRestore. */ +public final class CloudEndpointsPostRestoreSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_PostRestore.json + */ + /** + * Sample code: CloudEndpoints_PostRestore. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsPostRestore(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .postRestore( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + new PostRestoreRequest() + .withAzureFileShareUri( + "https://hfsazbackupdevintncus2.file.core.test-cint.azure-test.net/sampleFileShare") + .withStatus("Succeeded") + .withSourceAzureFileShareUri( + "https://hfsazbackupdevintncus2.file.core.test-cint.azure-test.net/sampleFileShare") + .withRestoreFileSpec( + Arrays + .asList( + new RestoreFileSpec().withPath("text1.txt").withIsdir(false), + new RestoreFileSpec().withPath("MyDir").withIsdir(true), + new RestoreFileSpec().withPath("MyDir/SubDir").withIsdir(false), + new RestoreFileSpec().withPath("MyDir/SubDir/File1.pdf").withIsdir(false))), + Context.NONE); + } +} +``` + +### CloudEndpoints_PreBackup + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.BackupRequest; + +/** Samples for CloudEndpoints PreBackup. */ +public final class CloudEndpointsPreBackupSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_PreBackup.json + */ + /** + * Sample code: CloudEndpoints_PreBackup. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsPreBackup(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .preBackup( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + new BackupRequest() + .withAzureFileShare("https://sampleserver.file.core.test-cint.azure-test.net/sampleFileShare"), + Context.NONE); + } +} +``` + +### CloudEndpoints_PreRestore + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.PreRestoreRequest; +import com.azure.resourcemanager.storagesync.models.RestoreFileSpec; +import java.util.Arrays; + +/** Samples for CloudEndpoints PreRestore. */ +public final class CloudEndpointsPreRestoreSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_PreRestore.json + */ + /** + * Sample code: CloudEndpoints_PreRestore. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsPreRestore(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .preRestore( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + new PreRestoreRequest() + .withAzureFileShareUri( + "https://hfsazbackupdevintncus2.file.core.test-cint.azure-test.net/sampleFileShare") + .withRestoreFileSpec( + Arrays + .asList( + new RestoreFileSpec().withPath("text1.txt").withIsdir(false), + new RestoreFileSpec().withPath("MyDir").withIsdir(true), + new RestoreFileSpec().withPath("MyDir/SubDir").withIsdir(false), + new RestoreFileSpec().withPath("MyDir/SubDir/File1.pdf").withIsdir(false))), + Context.NONE); + } +} +``` + +### CloudEndpoints_Restoreheartbeat + +```java +import com.azure.core.util.Context; + +/** Samples for CloudEndpoints Restoreheartbeat. */ +public final class CloudEndpointsRestoreheartbeatSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_RestoreHeatbeat.json + */ + /** + * Sample code: CloudEndpoints_restoreheartbeat. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsRestoreheartbeat( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .restoreheartbeatWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + Context.NONE); + } +} +``` + +### CloudEndpoints_TriggerChangeDetection + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.ChangeDetectionMode; +import com.azure.resourcemanager.storagesync.models.TriggerChangeDetectionParameters; + +/** Samples for CloudEndpoints TriggerChangeDetection. */ +public final class CloudEndpointsTriggerChangeDetectionSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_TriggerChangeDetection.json + */ + /** + * Sample code: CloudEndpoints_TriggerChangeDetection. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsTriggerChangeDetection( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .triggerChangeDetection( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + new TriggerChangeDetectionParameters() + .withDirectoryPath("NewDirectory") + .withChangeDetectionMode(ChangeDetectionMode.RECURSIVE), + Context.NONE); + } +} +``` + +### OperationStatusOperation_Get + +```java +import com.azure.core.util.Context; + +/** Samples for OperationStatusOperation Get. */ +public final class OperationStatusOperationGetSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/OperationStatus_Get.json + */ + /** + * Sample code: Workflows_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void workflowsGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .operationStatusOperations() + .getWithResponse( + "SampleResourceGroup_1", + "westus", + "828219ea-083e-48b5-89ea-8fd9991b2e75", + "14b50e24-f68d-4b29-a882-38be9dfb8bd1", + Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void operationsList(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Create + +```java +import com.azure.resourcemanager.storagesync.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.storagesync.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Create. */ +public final class PrivateEndpointConnectionsCreateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/PrivateEndpointConnections_Create.json + */ + /** + * Sample code: PrivateEndpointConnections_Create. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void privateEndpointConnectionsCreate( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .privateEndpointConnections() + .define("{privateEndpointConnectionName}") + .withExistingStorageSyncService("res7687", "sss2527") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/PrivateEndpointConnections_Delete.json + */ + /** + * Sample code: PrivateEndpointConnections_Delete. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void privateEndpointConnectionsDelete( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .privateEndpointConnections() + .delete("res6977", "sss2527", "{privateEndpointConnectionName}", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/PrivateEndpointConnections_Get.json + */ + /** + * Sample code: PrivateEndpointConnections_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void privateEndpointConnectionsGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("res6977", "sss2527", "{privateEndpointConnectionName}", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_ListByStorageSyncService + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections ListByStorageSyncService. */ +public final class PrivateEndpointConnectionsListByStorageSyncServiceSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/PrivateEndpointConnections_ListByStorageSyncService.json + */ + /** + * Sample code: PrivateEndpointConnections_ListByStorageSyncService. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void privateEndpointConnectionsListByStorageSyncService( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager.privateEndpointConnections().listByStorageSyncService("res6977", "sss2527", Context.NONE); + } +} +``` + +### PrivateLinkResources_ListByStorageSyncService + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByStorageSyncService. */ +public final class PrivateLinkResourcesListByStorageSyncServiceSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/PrivateLinkResources_List.json + */ + /** + * Sample code: PrivateLinkResources_List. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void privateLinkResourcesList(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager.privateLinkResources().listByStorageSyncServiceWithResponse("res6977", "sss2527", Context.NONE); + } +} +``` + +### RegisteredServers_Create + +```java +/** Samples for RegisteredServers Create. */ +public final class RegisteredServersCreateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/RegisteredServers_Create.json + */ + /** + * Sample code: RegisteredServers_Create. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void registeredServersCreate(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .registeredServers() + .define("080d4133-bdb5-40a0-96a0-71a6057bfe9a") + .withExistingStorageSyncService("SampleResourceGroup_1", "SampleStorageSyncService_1") + .withServerCertificate( + "MIIDFjCCAf6gAwIBAgIQQS+DS8uhc4VNzUkTw7wbRjANBgkqhkiG9w0BAQ0FADAzMTEwLwYDVQQDEyhhbmt1c2hiLXByb2QzLnJlZG1vbmQuY29ycC5taWNyb3NvZnQuY29tMB4XDTE3MDgwMzE3MDQyNFoXDTE4MDgwNDE3MDQyNFowMzExMC8GA1UEAxMoYW5rdXNoYi1wcm9kMy5yZWRtb25kLmNvcnAubWljcm9zb2Z0LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALDRvV4gmsIy6jGDPiHsXmvgVP749NNP7DopdlbHaNhjFmYINHl0uWylyaZmgJrROt2mnxN/zEyJtGnqYHlzUr4xvGq/qV5pqgdB9tag/sw9i22gfe9PRZ0FmSOZnXMbLYgLiDFqLtut5gHcOuWMj03YnkfoBEKlFBxWbagvW2yxz/Sxi9OVSJOKCaXra0RpcIHrO/KFl6ho2eE1/7Ykmfa8hZvSdoPd5gHdLiQcMB/pxq+mWp1fI6c8vFZoDu7Atn+NXTzYPKUxKzaisF12TsaKpohUsJpbB3Wocb0F5frn614D2pg14ERB5otjAMWw1m65csQWPI6dP8KIYe0+QPkCAwEAAaMmMCQwIgYDVR0lAQH/BBgwFgYIKwYBBQUHAwIGCisGAQQBgjcKAwwwDQYJKoZIhvcNAQENBQADggEBAA4RhVIBkw34M1RwakJgHvtjsOFxF1tVQA941NtLokx1l2Z8+GFQkcG4xpZSt+UN6wLerdCbnNhtkCErWUDeaT0jxk4g71Ofex7iM04crT4iHJr8mi96/XnhnkTUs+GDk12VgdeeNEczMZz+8Mxw9dJ5NCnYgTwO0SzGlclRsDvjzkLo8rh2ZG6n/jKrEyNXXo+hOqhupij0QbRP2Tvexdfw201kgN1jdZify8XzJ8Oi0bTS0KpJf2pNPOlooK2bjMUei9ANtEdXwwfVZGWvVh6tJjdv6k14wWWJ1L7zhA1IIVb1J+sQUzJji5iX0DrezjTz1Fg+gAzITaA/WsuujlM=") + .withAgentVersion("1.0.277.0") + .withServerOSVersion("10.0.14393.0") + .withServerRole("Standalone") + .withServerId("080d4133-bdb5-40a0-96a0-71a6057bfe9a") + .withFriendlyName("afscv-2304-139") + .create(); + } +} +``` + +### RegisteredServers_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RegisteredServers Delete. */ +public final class RegisteredServersDeleteSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/RegisteredServers_Delete.json + */ + /** + * Sample code: RegisteredServers_Delete. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void registeredServersDelete(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .registeredServers() + .delete( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "41166691-ab03-43e9-ab3e-0330eda162ac", + Context.NONE); + } +} +``` + +### RegisteredServers_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RegisteredServers Get. */ +public final class RegisteredServersGetSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/RegisteredServers_Get.json + */ + /** + * Sample code: RegisteredServers_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void registeredServersGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .registeredServers() + .getWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "080d4133-bdb5-40a0-96a0-71a6057bfe9a", + Context.NONE); + } +} +``` + +### RegisteredServers_ListByStorageSyncService + +```java +import com.azure.core.util.Context; + +/** Samples for RegisteredServers ListByStorageSyncService. */ +public final class RegisteredServersListByStorageSyncServiceSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/RegisteredServers_ListByStorageSyncService.json + */ + /** + * Sample code: RegisteredServers_ListByStorageSyncService. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void registeredServersListByStorageSyncService( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .registeredServers() + .listByStorageSyncService("SampleResourceGroup_1", "SampleStorageSyncService_1", Context.NONE); + } +} +``` + +### RegisteredServers_TriggerRollover + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.TriggerRolloverRequest; + +/** Samples for RegisteredServers TriggerRollover. */ +public final class RegisteredServersTriggerRolloverSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/RegisteredServers_TriggerRollover.json + */ + /** + * Sample code: RegisteredServers_triggerRollover. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void registeredServersTriggerRollover( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .registeredServers() + .triggerRollover( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "d166ca76-dad2-49df-b409-12345642d730", + new TriggerRolloverRequest() + .withServerCertificate( + "\"MIIDFjCCAf6gAwIBAgIQQS+DS8uhc4VNzUkTw7wbRjANBgkqhkiG9w0BAQ0FADAzMTEwLwYDVQQDEyhhbmt1c2hiLXByb2QzLnJlZG1vbmQuY29ycC5taWNyb3NvZnQuY29tMB4XDTE3MDgwMzE3MDQyNFoXDTE4MDgwNDE3MDQyNFowMzExMC8GA1UEAxMoYW5rdXNoYi1wcm9kMy5yZWRtb25kLmNvcnAubWljcm9zb2Z0LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALDRvV4gmsIy6jGDPiHsXmvgVP749NNP7DopdlbHaNhjFmYINHl0uWylyaZmgJrROt2mnxN/zEyJtGnqYHlzUr4xvGq/qV5pqgdB9tag/sw9i22gfe9PRZ0FmSOZnXMbLYgLiDFqLtut5gHcOuWMj03YnkfoBEKlFBxWbagvW2yxz/Sxi9OVSJOKCaXra0RpcIHrO/KFl6ho2eE1/7Ykmfa8hZvSdoPd5gHdLiQcMB/pxq+mWp1fI6c8vFZoDu7Atn+NXTzYPKUxKzaisF12TsaKpohUsJpbB3Wocb0F5frn614D2pg14ERB5otjAMWw1m65csQWPI6dP8KIYe0+QPkCAwEAAaMmMCQwIgYDVR0lAQH/BBgwFgYIKwYBBQUHAwIGCisGAQQBgjcKAwwwDQYJKoZIhvcNAQENBQADggEBAA4RhVIBkw34M1RwakJgHvtjsOFxF1tVQA941NtLokx1l2Z8+GFQkcG4xpZSt+UN6wLerdCbnNhtkCErWUDeaT0jxk4g71Ofex7iM04crT4iHJr8mi96/XnhnkTUs+GDk12VgdeeNEczMZz+8Mxw9dJ5NCnYgTwO0SzGlclRsDvjzkLo8rh2ZG6n/jKrEyNXXo+hOqhupij0QbRP2Tvexdfw201kgN1jdZify8XzJ8Oi0bTS0KpJf2pNPOlooK2bjMUei9ANtEdXwwfVZGWvVh6tJjdv6k14wWWJ1L7zhA1IIVb1J+sQUzJji5iX0DrezjTz1Fg+gAzITaA/WsuujlM=\""), + Context.NONE); + } +} +``` + +### ResourceProvider_LocationOperationStatus + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceProvider LocationOperationStatus. */ +public final class ResourceProviderLocationOperationStatusSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/LocationOperationStatus_Get.json + */ + /** + * Sample code: Workflows_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void workflowsGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .resourceProviders() + .locationOperationStatusWithResponse( + "westus", + "eyJwYXJ0aXRpb25JZCI6ImE1ZDNiMDU4LTYwN2MtNDI0Ny05Y2FmLWJlZmU4NGQ0ZDU0NyIsIndvcmtmbG93SWQiOiJjYzg1MTY2YS0xMjI2LTQ4MGYtYWM5ZC1jMmRhNTVmY2M2ODYiLCJ3b3JrZmxvd09wZXJhdGlvbklkIjoiOTdmODU5ZTAtOGY1MC00ZTg4LWJkZDEtNWZlYzgwYTVlYzM0tui=", + Context.NONE); + } +} +``` + +### ServerEndpoints_Create + +```java +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; + +/** Samples for ServerEndpoints Create. */ +public final class ServerEndpointsCreateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/ServerEndpoints_Create.json + */ + /** + * Sample code: ServerEndpoints_Create. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void serverEndpointsCreate(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .serverEndpoints() + .define("SampleServerEndpoint_1") + .withExistingSyncGroup("SampleResourceGroup_1", "SampleStorageSyncService_1", "SampleSyncGroup_1") + .withServerLocalPath("D:\\SampleServerEndpoint_1") + .withCloudTiering(FeatureStatus.OFF) + .withVolumeFreeSpacePercent(100) + .withTierFilesOlderThanDays(0) + .withServerResourceId( + "/subscriptions/52b8da2f-61e0-4a1f-8dde-336911f367fb/resourceGroups/SampleResourceGroup_1/providers/Microsoft.StorageSync/storageSyncServices/SampleStorageSyncService_1/registeredServers/080d4133-bdb5-40a0-96a0-71a6057bfe9a") + .withOfflineDataTransfer(FeatureStatus.ON) + .withOfflineDataTransferShareName("myfileshare") + .withInitialDownloadPolicy(InitialDownloadPolicy.NAMESPACE_THEN_MODIFIED_FILES) + .withLocalCacheMode(LocalCacheMode.UPDATE_LOCALLY_CACHED_FILES) + .withInitialUploadPolicy(InitialUploadPolicy.SERVER_AUTHORITATIVE) + .create(); + } +} +``` + +### ServerEndpoints_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ServerEndpoints Delete. */ +public final class ServerEndpointsDeleteSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/ServerEndpoints_Delete.json + */ + /** + * Sample code: ServerEndpoints_Delete. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void serverEndpointsDelete(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .serverEndpoints() + .delete( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleServerEndpoint_1", + Context.NONE); + } +} +``` + +### ServerEndpoints_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ServerEndpoints Get. */ +public final class ServerEndpointsGetSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/ServerEndpoints_Get.json + */ + /** + * Sample code: ServerEndpoints_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void serverEndpointsGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .serverEndpoints() + .getWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleServerEndpoint_1", + Context.NONE); + } +} +``` + +### ServerEndpoints_ListBySyncGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ServerEndpoints ListBySyncGroup. */ +public final class ServerEndpointsListBySyncGroupSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/ServerEndpoints_ListBySyncGroup.json + */ + /** + * Sample code: ServerEndpoints_ListBySyncGroup. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void serverEndpointsListBySyncGroup( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .serverEndpoints() + .listBySyncGroup("SampleResourceGroup_1", "SampleStorageSyncService_1", "SampleSyncGroup_1", Context.NONE); + } +} +``` + +### ServerEndpoints_RecallAction + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.RecallActionParameters; + +/** Samples for ServerEndpoints RecallAction. */ +public final class ServerEndpointsRecallActionSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/ServerEndpoints_Recall.json + */ + /** + * Sample code: ServerEndpoints_recallAction. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void serverEndpointsRecallAction(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .serverEndpoints() + .recallAction( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleServerEndpoint_1", + new RecallActionParameters().withPattern("").withRecallPath(""), + Context.NONE); + } +} +``` + +### ServerEndpoints_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.FeatureStatus; +import com.azure.resourcemanager.storagesync.models.LocalCacheMode; +import com.azure.resourcemanager.storagesync.models.ServerEndpoint; + +/** Samples for ServerEndpoints Update. */ +public final class ServerEndpointsUpdateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/ServerEndpoints_Update.json + */ + /** + * Sample code: ServerEndpoints_Update. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void serverEndpointsUpdate(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + ServerEndpoint resource = + manager + .serverEndpoints() + .getWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleServerEndpoint_1", + Context.NONE) + .getValue(); + resource + .update() + .withCloudTiering(FeatureStatus.OFF) + .withVolumeFreeSpacePercent(100) + .withTierFilesOlderThanDays(0) + .withOfflineDataTransfer(FeatureStatus.OFF) + .withLocalCacheMode(LocalCacheMode.UPDATE_LOCALLY_CACHED_FILES) + .apply(); + } +} +``` + +### StorageSyncServices_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.CheckNameAvailabilityParameters; + +/** Samples for StorageSyncServices CheckNameAvailability. */ +public final class StorageSyncServicesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServiceCheckNameAvailability_Available.json + */ + /** + * Sample code: StorageSyncServiceCheckNameAvailability_Available. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServiceCheckNameAvailabilityAvailable( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .storageSyncServices() + .checkNameAvailabilityWithResponse( + "westus", new CheckNameAvailabilityParameters().withName("newstoragesyncservicename"), Context.NONE); + } + + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServiceCheckNameAvailability_AlreadyExists.json + */ + /** + * Sample code: StorageSyncServiceCheckNameAvailability_AlreadyExists. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServiceCheckNameAvailabilityAlreadyExists( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .storageSyncServices() + .checkNameAvailabilityWithResponse( + "westus", new CheckNameAvailabilityParameters().withName("newstoragesyncservicename"), Context.NONE); + } +} +``` + +### StorageSyncServices_Create + +```java +import com.azure.resourcemanager.storagesync.models.IncomingTrafficPolicy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for StorageSyncServices Create. */ +public final class StorageSyncServicesCreateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServices_Create.json + */ + /** + * Sample code: StorageSyncServices_Create. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServicesCreate(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .storageSyncServices() + .define("SampleStorageSyncService_1") + .withRegion("WestUS") + .withExistingResourceGroup("SampleResourceGroup_1") + .withTags(mapOf()) + .withIncomingTrafficPolicy(IncomingTrafficPolicy.ALLOW_ALL_TRAFFIC) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### StorageSyncServices_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for StorageSyncServices Delete. */ +public final class StorageSyncServicesDeleteSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServices_Delete.json + */ + /** + * Sample code: StorageSyncServices_Delete. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServicesDelete(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager.storageSyncServices().delete("SampleResourceGroup_1", "SampleStorageSyncService_1", Context.NONE); + } +} +``` + +### StorageSyncServices_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for StorageSyncServices GetByResourceGroup. */ +public final class StorageSyncServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServices_Get.json + */ + /** + * Sample code: StorageSyncServices_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServicesGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .storageSyncServices() + .getByResourceGroupWithResponse("SampleResourceGroup_1", "SampleStorageSyncService_1", Context.NONE); + } +} +``` + +### StorageSyncServices_List + +```java +import com.azure.core.util.Context; + +/** Samples for StorageSyncServices List. */ +public final class StorageSyncServicesListSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServices_ListBySubscription.json + */ + /** + * Sample code: StorageSyncServices_ListBySubscription. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServicesListBySubscription( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager.storageSyncServices().list(Context.NONE); + } +} +``` + +### StorageSyncServices_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for StorageSyncServices ListByResourceGroup. */ +public final class StorageSyncServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServices_ListByResourceGroup.json + */ + /** + * Sample code: StorageSyncServices_ListByResourceGroup. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServicesListByResourceGroup( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager.storageSyncServices().listByResourceGroup("SampleResourceGroup_1", Context.NONE); + } +} +``` + +### StorageSyncServices_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.IncomingTrafficPolicy; +import com.azure.resourcemanager.storagesync.models.StorageSyncService; +import java.util.HashMap; +import java.util.Map; + +/** Samples for StorageSyncServices Update. */ +public final class StorageSyncServicesUpdateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServices_Update.json + */ + /** + * Sample code: StorageSyncServices_Update. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServicesUpdate(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + StorageSyncService resource = + manager + .storageSyncServices() + .getByResourceGroupWithResponse("SampleResourceGroup_1", "SampleStorageSyncService_1", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("Dept", "IT", "Environment", "Test")) + .withIncomingTrafficPolicy(IncomingTrafficPolicy.ALLOW_ALL_TRAFFIC) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SyncGroups_Create + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** Samples for SyncGroups Create. */ +public final class SyncGroupsCreateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/SyncGroups_Create.json + */ + /** + * Sample code: SyncGroups_Create. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void syncGroupsCreate(com.azure.resourcemanager.storagesync.StoragesyncManager manager) + throws IOException { + manager + .syncGroups() + .define("SampleSyncGroup_1") + .withExistingStorageSyncService("SampleResourceGroup_1", "SampleStorageSyncService_1") + .withProperties( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .create(); + } +} +``` + +### SyncGroups_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for SyncGroups Delete. */ +public final class SyncGroupsDeleteSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/SyncGroups_Delete.json + */ + /** + * Sample code: SyncGroups_Delete. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void syncGroupsDelete(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .syncGroups() + .deleteWithResponse( + "SampleResourceGroup_1", "SampleStorageSyncService_1", "SampleSyncGroup_1", Context.NONE); + } +} +``` + +### SyncGroups_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SyncGroups Get. */ +public final class SyncGroupsGetSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/SyncGroups_Get.json + */ + /** + * Sample code: SyncGroups_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void syncGroupsGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .syncGroups() + .getWithResponse("SampleResourceGroup_1", "SampleStorageSyncService_1", "SampleSyncGroup_1", Context.NONE); + } +} +``` + +### SyncGroups_ListByStorageSyncService + +```java +import com.azure.core.util.Context; + +/** Samples for SyncGroups ListByStorageSyncService. */ +public final class SyncGroupsListByStorageSyncServiceSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/SyncGroups_ListByStorageSyncService.json + */ + /** + * Sample code: SyncGroups_ListByStorageSyncService. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void syncGroupsListByStorageSyncService( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .syncGroups() + .listByStorageSyncService("SampleResourceGroup_1", "SampleStorageSyncService_1", Context.NONE); + } +} +``` + +### Workflows_Abort + +```java +import com.azure.core.util.Context; + +/** Samples for Workflows Abort. */ +public final class WorkflowsAbortSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/Workflows_Abort.json + */ + /** + * Sample code: Workflows_Abort. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void workflowsAbort(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .workflows() + .abortWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "7ffd50b3-5574-478d-9ff2-9371bc42ce68", + Context.NONE); + } +} +``` + +### Workflows_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Workflows Get. */ +public final class WorkflowsGetSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/Workflows_Get.json + */ + /** + * Sample code: Workflows_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void workflowsGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .workflows() + .getWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "828219ea-083e-48b5-89ea-8fd9991b2e75", + Context.NONE); + } +} +``` + +### Workflows_ListByStorageSyncService + +```java +import com.azure.core.util.Context; + +/** Samples for Workflows ListByStorageSyncService. */ +public final class WorkflowsListByStorageSyncServiceSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/Workflows_ListByStorageSyncService.json + */ + /** + * Sample code: Workflows_ListByStorageSyncService. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void workflowsListByStorageSyncService( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .workflows() + .listByStorageSyncService("SampleResourceGroup_1", "SampleStorageSyncService_1", Context.NONE); + } +} +``` + diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/pom.xml b/sdk/storagesync/azure-resourcemanager-storagesync/pom.xml new file mode 100644 index 0000000000000..2729687d44466 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-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-2022-06-01. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.32.0 + + + com.azure + azure-core-management + 1.8.0 + + + 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..ee07b2a3700da --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/StoragesyncManager.java @@ -0,0 +1,444 @@ +// 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.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.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.ResourceProvidersImpl; +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.ResourceProviders; +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; +import java.util.stream.Collectors; + +/** 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 ResourceProviders resourceProviders; + + 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); + } + + /** + * Creates an instance of storagesync service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the storagesync service API instance. + */ + public static StoragesyncManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new StoragesyncManager(httpPipeline, profile, null); + } + + /** + * 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 static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of 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 (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new StoragesyncManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of StorageSyncServices. It manages StorageSyncService. + * + * @return Resource collection API of StorageSyncServices. + */ + public StorageSyncServices storageSyncServices() { + if (this.storageSyncServices == null) { + this.storageSyncServices = new StorageSyncServicesImpl(clientObject.getStorageSyncServices(), this); + } + return storageSyncServices; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of SyncGroups. It manages SyncGroup. + * + * @return Resource collection API of SyncGroups. + */ + public SyncGroups syncGroups() { + if (this.syncGroups == null) { + this.syncGroups = new SyncGroupsImpl(clientObject.getSyncGroups(), this); + } + return syncGroups; + } + + /** + * Gets the resource collection API of CloudEndpoints. It manages CloudEndpoint. + * + * @return Resource collection API of CloudEndpoints. + */ + public CloudEndpoints cloudEndpoints() { + if (this.cloudEndpoints == null) { + this.cloudEndpoints = new CloudEndpointsImpl(clientObject.getCloudEndpoints(), this); + } + return cloudEndpoints; + } + + /** + * Gets the resource collection API of ServerEndpoints. It manages ServerEndpoint. + * + * @return Resource collection API of ServerEndpoints. + */ + public ServerEndpoints serverEndpoints() { + if (this.serverEndpoints == null) { + this.serverEndpoints = new ServerEndpointsImpl(clientObject.getServerEndpoints(), this); + } + return serverEndpoints; + } + + /** + * Gets the resource collection API of RegisteredServers. It manages RegisteredServer. + * + * @return Resource collection API of RegisteredServers. + */ + public RegisteredServers registeredServers() { + if (this.registeredServers == null) { + this.registeredServers = new RegisteredServersImpl(clientObject.getRegisteredServers(), this); + } + return registeredServers; + } + + /** + * Gets the resource collection API of Workflows. + * + * @return Resource collection API of Workflows. + */ + public Workflows workflows() { + if (this.workflows == null) { + this.workflows = new WorkflowsImpl(clientObject.getWorkflows(), this); + } + return workflows; + } + + /** + * Gets the resource collection API of OperationStatusOperations. + * + * @return Resource collection API of OperationStatusOperations. + */ + public OperationStatusOperations operationStatusOperations() { + if (this.operationStatusOperations == null) { + this.operationStatusOperations = + new OperationStatusOperationsImpl(clientObject.getOperationStatusOperations(), this); + } + return operationStatusOperations; + } + + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** + * @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..f43e68d43acdc --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/CloudEndpointsClient.java @@ -0,0 +1,799 @@ +// 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.CloudEndpointAfsShareMetadataCertificatePublicKeysInner; +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.CloudEndpointsAfsShareMetadataCertificatePublicKeysResponse; +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 the {@link SyncPoller} for polling of cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of post Backup Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of post Backup Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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); + + /** + * Get the AFS file share metadata signing certificate public keys. + * + * @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 AFS file share metadata signing certificate public keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudEndpointAfsShareMetadataCertificatePublicKeysInner afsShareMetadataCertificatePublicKeys( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName); + + /** + * Get the AFS file share metadata signing certificate public keys. + * + * @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 AFS file share metadata signing certificate public keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudEndpointsAfsShareMetadataCertificatePublicKeysResponse afsShareMetadataCertificatePublicKeysWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + 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..2ce15ca74a3d3 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/MicrosoftStorageSync.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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(); + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); +} 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..93cb27619ddc0 --- /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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..6fcc615bf9581 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,239 @@ +// 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 along with {@link + * Response}. + */ + @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 {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..196ab2699dfad --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 along with {@link + * Response}. + */ + @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..cc4aa6131c5c2 --- /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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 the {@link SyncPoller} for polling of registered Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of registered Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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/ResourceProvidersClient.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/ResourceProvidersClient.java new file mode 100644 index 0000000000000..fa23c3ebcdabb --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/ResourceProvidersClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.LocationOperationStatusInner; +import com.azure.resourcemanager.storagesync.models.ResourceProvidersLocationOperationStatusResponse; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * Get Operation status. + * + * @param locationName The desired region to obtain information from. + * @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) + LocationOperationStatusInner locationOperationStatus(String locationName, String operationId); + + /** + * Get Operation status. + * + * @param locationName The desired region to obtain information from. + * @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) + ResourceProvidersLocationOperationStatusResponse locationOperationStatusWithResponse( + String locationName, String operationId, 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..f3cf12ebfda1d --- /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 the {@link SyncPoller} for polling of server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..25e2b92810354 --- /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 along with {@link 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 the {@link SyncPoller} for polling of storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..67e333563b5a0 --- /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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..7bb237287ee11 --- /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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..d1e94b6a8327e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CheckNameAvailabilityResultInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storagesync.models.NameAvailabilityReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CheckNameAvailability operation response. */ +@Immutable +public final class CheckNameAvailabilityResultInner { + /* + * 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/CloudEndpointAfsShareMetadataCertificatePublicKeysInner.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CloudEndpointAfsShareMetadataCertificatePublicKeysInner.java new file mode 100644 index 0000000000000..14573c7ce8128 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CloudEndpointAfsShareMetadataCertificatePublicKeysInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cloud endpoint AFS file share metadata signing certificate public keys. */ +@Immutable +public final class CloudEndpointAfsShareMetadataCertificatePublicKeysInner { + /* + * The first public key. + */ + @JsonProperty(value = "firstKey", access = JsonProperty.Access.WRITE_ONLY) + private String firstKey; + + /* + * The second public key. + */ + @JsonProperty(value = "secondKey", access = JsonProperty.Access.WRITE_ONLY) + private String secondKey; + + /** + * Get the firstKey property: The first public key. + * + * @return the firstKey value. + */ + public String firstKey() { + return this.firstKey; + } + + /** + * Get the secondKey property: The second public key. + * + * @return the secondKey value. + */ + public String secondKey() { + return this.secondKey; + } + + /** + * 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/CloudEndpointCreateParametersProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CloudEndpointCreateParametersProperties.java new file mode 100644 index 0000000000000..3d65692e146ba --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CloudEndpointCreateParametersProperties.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** CloudEndpoint Properties object. */ +@Fluent +public final class CloudEndpointCreateParametersProperties { + /* + * Storage Account Resource Id + */ + @JsonProperty(value = "storageAccountResourceId") + private String storageAccountResourceId; + + /* + * Azure file share name + */ + @JsonProperty(value = "azureFileShareName") + private String azureFileShareName; + + /* + * Storage Account Tenant Id + */ + @JsonProperty(value = "storageAccountTenantId") + private String storageAccountTenantId; + + /* + * Friendly Name + */ + @JsonProperty(value = "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 CloudEndpointCreateParametersProperties object itself. + */ + public CloudEndpointCreateParametersProperties 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 CloudEndpointCreateParametersProperties object itself. + */ + public CloudEndpointCreateParametersProperties 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 CloudEndpointCreateParametersProperties object itself. + */ + public CloudEndpointCreateParametersProperties 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 CloudEndpointCreateParametersProperties object itself. + */ + public CloudEndpointCreateParametersProperties 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/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..6cceaa2b18080 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CloudEndpointInner.java @@ -0,0 +1,258 @@ +// 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.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.storagesync.models.CloudEndpointChangeEnumerationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cloud Endpoint object. */ +@Fluent +public final class CloudEndpointInner extends ProxyResource { + /* + * Cloud Endpoint properties. + */ + @JsonProperty(value = "properties") + private CloudEndpointProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Cloud Endpoint properties. + * + * @return the innerProperties value. + */ + private CloudEndpointProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the storageAccountResourceId property: Storage Account Resource Id. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudEndpointProperties(); + } + this.innerProperties().withStorageAccountResourceId(storageAccountResourceId); + return this; + } + + /** + * Get the azureFileShareName property: Azure file share name. + * + * @return the azureFileShareName value. + */ + public String azureFileShareName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudEndpointProperties(); + } + this.innerProperties().withAzureFileShareName(azureFileShareName); + return this; + } + + /** + * Get the storageAccountTenantId property: Storage Account Tenant Id. + * + * @return the storageAccountTenantId value. + */ + public String storageAccountTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudEndpointProperties(); + } + this.innerProperties().withStorageAccountTenantId(storageAccountTenantId); + return this; + } + + /** + * Get the partnershipId property: Partnership Id. + * + * @return the partnershipId value. + */ + public String partnershipId() { + return this.innerProperties() == null ? null : this.innerProperties().partnershipId(); + } + + /** + * Set the partnershipId property: Partnership Id. + * + * @param partnershipId the partnershipId value to set. + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withPartnershipId(String partnershipId) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudEndpointProperties(); + } + this.innerProperties().withPartnershipId(partnershipId); + return this; + } + + /** + * Get the friendlyName property: Friendly Name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Set the friendlyName property: Friendly Name. + * + * @param friendlyName the friendlyName value to set. + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withFriendlyName(String friendlyName) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudEndpointProperties(); + } + this.innerProperties().withFriendlyName(friendlyName); + return this; + } + + /** + * Get the backupEnabled property: Backup Enabled. + * + * @return the backupEnabled value. + */ + public String backupEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().backupEnabled(); + } + + /** + * Get the provisioningState property: CloudEndpoint Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudEndpointProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the lastWorkflowId property: CloudEndpoint lastWorkflowId. + * + * @return the lastWorkflowId value. + */ + public String lastWorkflowId() { + return this.innerProperties() == null ? null : this.innerProperties().lastWorkflowId(); + } + + /** + * Set the lastWorkflowId property: CloudEndpoint lastWorkflowId. + * + * @param lastWorkflowId the lastWorkflowId value to set. + * @return the CloudEndpointInner object itself. + */ + public CloudEndpointInner withLastWorkflowId(String lastWorkflowId) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudEndpointProperties(); + } + this.innerProperties().withLastWorkflowId(lastWorkflowId); + return this; + } + + /** + * Get the lastOperationName property: Resource Last Operation Name. + * + * @return the lastOperationName value. + */ + public String lastOperationName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudEndpointProperties(); + } + this.innerProperties().withLastOperationName(lastOperationName); + return this; + } + + /** + * Get the changeEnumerationStatus property: Cloud endpoint change enumeration status. + * + * @return the changeEnumerationStatus value. + */ + public CloudEndpointChangeEnumerationStatus changeEnumerationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().changeEnumerationStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CloudEndpointProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CloudEndpointProperties.java new file mode 100644 index 0000000000000..762c9f25f1ad9 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/CloudEndpointProperties.java @@ -0,0 +1,262 @@ +// 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.resourcemanager.storagesync.models.CloudEndpointChangeEnumerationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** CloudEndpoint Properties object. */ +@Fluent +public final class CloudEndpointProperties { + /* + * Storage Account Resource Id + */ + @JsonProperty(value = "storageAccountResourceId") + private String storageAccountResourceId; + + /* + * Azure file share name + */ + @JsonProperty(value = "azureFileShareName") + private String azureFileShareName; + + /* + * Storage Account Tenant Id + */ + @JsonProperty(value = "storageAccountTenantId") + private String storageAccountTenantId; + + /* + * Partnership Id + */ + @JsonProperty(value = "partnershipId") + private String partnershipId; + + /* + * Friendly Name + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Backup Enabled + */ + @JsonProperty(value = "backupEnabled", access = JsonProperty.Access.WRITE_ONLY) + private String backupEnabled; + + /* + * CloudEndpoint Provisioning State + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /* + * CloudEndpoint lastWorkflowId + */ + @JsonProperty(value = "lastWorkflowId") + private String lastWorkflowId; + + /* + * Resource Last Operation Name + */ + @JsonProperty(value = "lastOperationName") + private String lastOperationName; + + /* + * Cloud endpoint change enumeration status + */ + @JsonProperty(value = "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 CloudEndpointProperties object itself. + */ + public CloudEndpointProperties 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 CloudEndpointProperties object itself. + */ + public CloudEndpointProperties 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 CloudEndpointProperties object itself. + */ + public CloudEndpointProperties 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 CloudEndpointProperties object itself. + */ + public CloudEndpointProperties 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 CloudEndpointProperties object itself. + */ + public CloudEndpointProperties 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 CloudEndpointProperties object itself. + */ + public CloudEndpointProperties 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 CloudEndpointProperties object itself. + */ + public CloudEndpointProperties 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 CloudEndpointProperties object itself. + */ + public CloudEndpointProperties 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/LocationOperationStatusInner.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/LocationOperationStatusInner.java new file mode 100644 index 0000000000000..75c25ce932675 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/LocationOperationStatusInner.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storagesync.models.StorageSyncApiError; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Operation status object. */ +@Immutable +public final class LocationOperationStatusInner { + /* + * Operation resource Id + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * 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; + + /* + * Percent complete. + */ + @JsonProperty(value = "percentComplete", access = JsonProperty.Access.WRITE_ONLY) + private Integer percentComplete; + + /** + * Get the id property: Operation resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * 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; + } + + /** + * Get the percentComplete property: Percent complete. + * + * @return the percentComplete value. + */ + public Integer percentComplete() { + return this.percentComplete; + } + + /** + * 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/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..11bcbe181a6e4 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/OperationEntityInner.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storagesync.models.OperationDisplayInfo; +import com.azure.resourcemanager.storagesync.models.OperationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The operation supported by storage sync. */ +@Fluent +public final class OperationEntityInner { + /* + * 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..28889c3280cc2 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/OperationStatusInner.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.storagesync.models.StorageSyncApiError; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Operation status object. */ +@Immutable +public final class OperationStatusInner { + /* + * 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..822216122d4d0 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PostBackupResponseInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Post Backup Response. */ +@Fluent +public final class PostBackupResponseInner { + /* + * Post Backup Response Properties + */ + @JsonProperty(value = "backupMetadata") + private PostBackupResponseProperties innerBackupMetadata; + + /** + * Get the innerBackupMetadata property: Post Backup Response Properties. + * + * @return the innerBackupMetadata value. + */ + private PostBackupResponseProperties innerBackupMetadata() { + return this.innerBackupMetadata; + } + + /** + * Get the cloudEndpointName property: cloud endpoint Name. + * + * @return the cloudEndpointName value. + */ + public String cloudEndpointName() { + return this.innerBackupMetadata() == null ? null : this.innerBackupMetadata().cloudEndpointName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerBackupMetadata() != null) { + innerBackupMetadata().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PostBackupResponseProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PostBackupResponseProperties.java new file mode 100644 index 0000000000000..5682b30e68cbd --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PostBackupResponseProperties.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Post Backup Response Properties object. */ +@Immutable +public final class PostBackupResponseProperties { + /* + * cloud endpoint Name. + */ + @JsonProperty(value = "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..c7c59da914f48 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +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.JsonProperty; + +/** The Private Endpoint Connection resource. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..17e43a5ecd979 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PrivateEndpointConnectionProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +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.JsonProperty; + +/** Properties of the PrivateEndpointConnectProperties. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * The resource of private end point. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "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 PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); +} 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..a37164a20e1a5 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PrivateLinkResourceListResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storagesync.models.PrivateLinkResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResultInner { + /* + * 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/PrivateLinkResourceProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..d57719e91e307 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/PrivateLinkResourceProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/RegisteredServerCreateParametersProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/RegisteredServerCreateParametersProperties.java new file mode 100644 index 0000000000000..1a126d342b763 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/RegisteredServerCreateParametersProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** RegisteredServer Create Properties object. */ +@Fluent +public final class RegisteredServerCreateParametersProperties { + /* + * Registered Server Certificate + */ + @JsonProperty(value = "serverCertificate") + private String serverCertificate; + + /* + * Registered Server Agent Version + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /* + * Registered Server OS Version + */ + @JsonProperty(value = "serverOSVersion") + private String serverOSVersion; + + /* + * Registered Server last heart beat + */ + @JsonProperty(value = "lastHeartBeat") + private String lastHeartBeat; + + /* + * Registered Server serverRole + */ + @JsonProperty(value = "serverRole") + private String serverRole; + + /* + * Registered Server clusterId + */ + @JsonProperty(value = "clusterId") + private String clusterId; + + /* + * Registered Server clusterName + */ + @JsonProperty(value = "clusterName") + private String clusterName; + + /* + * Registered Server serverId + */ + @JsonProperty(value = "serverId") + private String serverId; + + /* + * Friendly Name + */ + @JsonProperty(value = "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 RegisteredServerCreateParametersProperties object itself. + */ + public RegisteredServerCreateParametersProperties 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 RegisteredServerCreateParametersProperties object itself. + */ + public RegisteredServerCreateParametersProperties 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 RegisteredServerCreateParametersProperties object itself. + */ + public RegisteredServerCreateParametersProperties 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 RegisteredServerCreateParametersProperties object itself. + */ + public RegisteredServerCreateParametersProperties 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 RegisteredServerCreateParametersProperties object itself. + */ + public RegisteredServerCreateParametersProperties 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 RegisteredServerCreateParametersProperties object itself. + */ + public RegisteredServerCreateParametersProperties 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 RegisteredServerCreateParametersProperties object itself. + */ + public RegisteredServerCreateParametersProperties 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 RegisteredServerCreateParametersProperties object itself. + */ + public RegisteredServerCreateParametersProperties 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 RegisteredServerCreateParametersProperties object itself. + */ + public RegisteredServerCreateParametersProperties 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/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..9f67da4c0a255 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/RegisteredServerInner.java @@ -0,0 +1,544 @@ +// 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.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.storagesync.models.RegisteredServerAgentVersionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Registered Server resource. */ +@Fluent +public final class RegisteredServerInner extends ProxyResource { + /* + * RegisteredServer properties. + */ + @JsonProperty(value = "properties") + private RegisteredServerProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: RegisteredServer properties. + * + * @return the innerProperties value. + */ + private RegisteredServerProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the serverCertificate property: Registered Server Certificate. + * + * @return the serverCertificate value. + */ + public String serverCertificate() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withServerCertificate(serverCertificate); + return this; + } + + /** + * Get the agentVersion property: Registered Server Agent Version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withAgentVersion(agentVersion); + return this; + } + + /** + * Get the agentVersionStatus property: Registered Server Agent Version Status. + * + * @return the agentVersionStatus value. + */ + public RegisteredServerAgentVersionStatus agentVersionStatus() { + return this.innerProperties() == null ? null : this.innerProperties().agentVersionStatus(); + } + + /** + * Get the agentVersionExpirationDate property: Registered Server Agent Version Expiration Date. + * + * @return the agentVersionExpirationDate value. + */ + public OffsetDateTime agentVersionExpirationDate() { + return this.innerProperties() == null ? null : this.innerProperties().agentVersionExpirationDate(); + } + + /** + * Get the serverOSVersion property: Registered Server OS Version. + * + * @return the serverOSVersion value. + */ + public String serverOSVersion() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withServerOSVersion(serverOSVersion); + return this; + } + + /** + * Get the serverManagementErrorCode property: Registered Server Management Error Code. + * + * @return the serverManagementErrorCode value. + */ + public Integer serverManagementErrorCode() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withServerManagementErrorCode(serverManagementErrorCode); + return this; + } + + /** + * Get the lastHeartBeat property: Registered Server last heart beat. + * + * @return the lastHeartBeat value. + */ + public String lastHeartBeat() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withLastHeartBeat(lastHeartBeat); + return this; + } + + /** + * Get the provisioningState property: Registered Server Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the serverRole property: Registered Server serverRole. + * + * @return the serverRole value. + */ + public String serverRole() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withServerRole(serverRole); + return this; + } + + /** + * Get the clusterId property: Registered Server clusterId. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withClusterId(clusterId); + return this; + } + + /** + * Get the clusterName property: Registered Server clusterName. + * + * @return the clusterName value. + */ + public String clusterName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withClusterName(clusterName); + return this; + } + + /** + * Get the serverId property: Registered Server serverId. + * + * @return the serverId value. + */ + public String serverId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withServerId(serverId); + return this; + } + + /** + * Get the storageSyncServiceUid property: Registered Server storageSyncServiceUid. + * + * @return the storageSyncServiceUid value. + */ + public String storageSyncServiceUid() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withStorageSyncServiceUid(storageSyncServiceUid); + return this; + } + + /** + * Get the lastWorkflowId property: Registered Server lastWorkflowId. + * + * @return the lastWorkflowId value. + */ + public String lastWorkflowId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withLastWorkflowId(lastWorkflowId); + return this; + } + + /** + * Get the lastOperationName property: Resource Last Operation Name. + * + * @return the lastOperationName value. + */ + public String lastOperationName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withLastOperationName(lastOperationName); + return this; + } + + /** + * Get the discoveryEndpointUri property: Resource discoveryEndpointUri. + * + * @return the discoveryEndpointUri value. + */ + public String discoveryEndpointUri() { + return this.innerProperties() == null ? null : this.innerProperties().discoveryEndpointUri(); + } + + /** + * Set the discoveryEndpointUri property: Resource discoveryEndpointUri. + * + * @param discoveryEndpointUri the discoveryEndpointUri value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withDiscoveryEndpointUri(String discoveryEndpointUri) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withDiscoveryEndpointUri(discoveryEndpointUri); + return this; + } + + /** + * Get the resourceLocation property: Resource Location. + * + * @return the resourceLocation value. + */ + public String resourceLocation() { + return this.innerProperties() == null ? null : this.innerProperties().resourceLocation(); + } + + /** + * Set the resourceLocation property: Resource Location. + * + * @param resourceLocation the resourceLocation value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withResourceLocation(String resourceLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withResourceLocation(resourceLocation); + return this; + } + + /** + * Get the serviceLocation property: Service Location. + * + * @return the serviceLocation value. + */ + public String serviceLocation() { + return this.innerProperties() == null ? null : this.innerProperties().serviceLocation(); + } + + /** + * Set the serviceLocation property: Service Location. + * + * @param serviceLocation the serviceLocation value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withServiceLocation(String serviceLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withServiceLocation(serviceLocation); + return this; + } + + /** + * Get the friendlyName property: Friendly Name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Set the friendlyName property: Friendly Name. + * + * @param friendlyName the friendlyName value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withFriendlyName(String friendlyName) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withFriendlyName(friendlyName); + return this; + } + + /** + * Get the managementEndpointUri property: Management Endpoint Uri. + * + * @return the managementEndpointUri value. + */ + public String managementEndpointUri() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withManagementEndpointUri(managementEndpointUri); + return this; + } + + /** + * Get the monitoringEndpointUri property: Telemetry Endpoint Uri. + * + * @return the monitoringEndpointUri value. + */ + public String monitoringEndpointUri() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withMonitoringEndpointUri(monitoringEndpointUri); + return this; + } + + /** + * Get the monitoringConfiguration property: Monitoring Configuration. + * + * @return the monitoringConfiguration value. + */ + public String monitoringConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().monitoringConfiguration(); + } + + /** + * Set the monitoringConfiguration property: Monitoring Configuration. + * + * @param monitoringConfiguration the monitoringConfiguration value to set. + * @return the RegisteredServerInner object itself. + */ + public RegisteredServerInner withMonitoringConfiguration(String monitoringConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerProperties(); + } + this.innerProperties().withMonitoringConfiguration(monitoringConfiguration); + return this; + } + + /** + * Get the serverName property: Server name. + * + * @return the serverName value. + */ + public String serverName() { + return this.innerProperties() == null ? null : this.innerProperties().serverName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/RegisteredServerProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/RegisteredServerProperties.java new file mode 100644 index 0000000000000..910ca3e3ac2ae --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/RegisteredServerProperties.java @@ -0,0 +1,587 @@ +// 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.resourcemanager.storagesync.models.RegisteredServerAgentVersionStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** RegisteredServer Properties object. */ +@Fluent +public final class RegisteredServerProperties { + /* + * Registered Server Certificate + */ + @JsonProperty(value = "serverCertificate") + private String serverCertificate; + + /* + * Registered Server Agent Version + */ + @JsonProperty(value = "agentVersion") + private String agentVersion; + + /* + * Registered Server Agent Version Status + */ + @JsonProperty(value = "agentVersionStatus", access = JsonProperty.Access.WRITE_ONLY) + private RegisteredServerAgentVersionStatus agentVersionStatus; + + /* + * Registered Server Agent Version Expiration Date + */ + @JsonProperty(value = "agentVersionExpirationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime agentVersionExpirationDate; + + /* + * Registered Server OS Version + */ + @JsonProperty(value = "serverOSVersion") + private String serverOSVersion; + + /* + * Registered Server Management Error Code + */ + @JsonProperty(value = "serverManagementErrorCode") + private Integer serverManagementErrorCode; + + /* + * Registered Server last heart beat + */ + @JsonProperty(value = "lastHeartBeat") + private String lastHeartBeat; + + /* + * Registered Server Provisioning State + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /* + * Registered Server serverRole + */ + @JsonProperty(value = "serverRole") + private String serverRole; + + /* + * Registered Server clusterId + */ + @JsonProperty(value = "clusterId") + private String clusterId; + + /* + * Registered Server clusterName + */ + @JsonProperty(value = "clusterName") + private String clusterName; + + /* + * Registered Server serverId + */ + @JsonProperty(value = "serverId") + private String serverId; + + /* + * Registered Server storageSyncServiceUid + */ + @JsonProperty(value = "storageSyncServiceUid") + private String storageSyncServiceUid; + + /* + * Registered Server lastWorkflowId + */ + @JsonProperty(value = "lastWorkflowId") + private String lastWorkflowId; + + /* + * Resource Last Operation Name + */ + @JsonProperty(value = "lastOperationName") + private String lastOperationName; + + /* + * Resource discoveryEndpointUri + */ + @JsonProperty(value = "discoveryEndpointUri") + private String discoveryEndpointUri; + + /* + * Resource Location + */ + @JsonProperty(value = "resourceLocation") + private String resourceLocation; + + /* + * Service Location + */ + @JsonProperty(value = "serviceLocation") + private String serviceLocation; + + /* + * Friendly Name + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Management Endpoint Uri + */ + @JsonProperty(value = "managementEndpointUri") + private String managementEndpointUri; + + /* + * Telemetry Endpoint Uri + */ + @JsonProperty(value = "monitoringEndpointUri") + private String monitoringEndpointUri; + + /* + * Monitoring Configuration + */ + @JsonProperty(value = "monitoringConfiguration") + private String monitoringConfiguration; + + /* + * Server name + */ + @JsonProperty(value = "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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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 RegisteredServerProperties object itself. + */ + public RegisteredServerProperties 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/ServerEndpointCreateParametersProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/ServerEndpointCreateParametersProperties.java new file mode 100644 index 0000000000000..322915858b2d2 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/ServerEndpointCreateParametersProperties.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.fluent.models; + +import com.azure.core.annotation.Fluent; +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.fasterxml.jackson.annotation.JsonProperty; + +/** ServerEndpoint Properties object. */ +@Fluent +public final class ServerEndpointCreateParametersProperties { + /* + * Server Local path. + */ + @JsonProperty(value = "serverLocalPath") + private String serverLocalPath; + + /* + * Cloud Tiering. + */ + @JsonProperty(value = "cloudTiering") + private FeatureStatus cloudTiering; + + /* + * Level of free space to be maintained by Cloud Tiering if it is enabled. + */ + @JsonProperty(value = "volumeFreeSpacePercent") + private Integer volumeFreeSpacePercent; + + /* + * Tier files older than days. + */ + @JsonProperty(value = "tierFilesOlderThanDays") + private Integer tierFilesOlderThanDays; + + /* + * Friendly Name + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Server Resource Id. + */ + @JsonProperty(value = "serverResourceId") + private String serverResourceId; + + /* + * Offline data transfer + */ + @JsonProperty(value = "offlineDataTransfer") + private FeatureStatus offlineDataTransfer; + + /* + * Offline data transfer share name + */ + @JsonProperty(value = "offlineDataTransferShareName") + private String offlineDataTransferShareName; + + /* + * Policy for how namespace and files are recalled during FastDr. + */ + @JsonProperty(value = "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 = "localCacheMode") + private LocalCacheMode localCacheMode; + + /* + * Policy for how the initial upload sync session is performed. + */ + @JsonProperty(value = "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 ServerEndpointCreateParametersProperties object itself. + */ + public ServerEndpointCreateParametersProperties 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 ServerEndpointCreateParametersProperties object itself. + */ + public ServerEndpointCreateParametersProperties 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 ServerEndpointCreateParametersProperties object itself. + */ + public ServerEndpointCreateParametersProperties 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 ServerEndpointCreateParametersProperties object itself. + */ + public ServerEndpointCreateParametersProperties 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 ServerEndpointCreateParametersProperties object itself. + */ + public ServerEndpointCreateParametersProperties 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 ServerEndpointCreateParametersProperties object itself. + */ + public ServerEndpointCreateParametersProperties 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 ServerEndpointCreateParametersProperties object itself. + */ + public ServerEndpointCreateParametersProperties 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 ServerEndpointCreateParametersProperties object itself. + */ + public ServerEndpointCreateParametersProperties 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 ServerEndpointCreateParametersProperties object itself. + */ + public ServerEndpointCreateParametersProperties 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 ServerEndpointCreateParametersProperties object itself. + */ + public ServerEndpointCreateParametersProperties 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 ServerEndpointCreateParametersProperties object itself. + */ + public ServerEndpointCreateParametersProperties 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/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..f11797db92aa9 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/ServerEndpointInner.java @@ -0,0 +1,402 @@ +// 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.management.ProxyResource; +import com.azure.core.management.SystemData; +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.JsonProperty; + +/** Server Endpoint object. */ +@Fluent +public final class ServerEndpointInner extends ProxyResource { + /* + * Server Endpoint properties. + */ + @JsonProperty(value = "properties") + private ServerEndpointProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Server Endpoint properties. + * + * @return the innerProperties value. + */ + private ServerEndpointProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the serverLocalPath property: Server Local path. + * + * @return the serverLocalPath value. + */ + public String serverLocalPath() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointProperties(); + } + this.innerProperties().withServerLocalPath(serverLocalPath); + return this; + } + + /** + * Get the cloudTiering property: Cloud Tiering. + * + * @return the cloudTiering value. + */ + public FeatureStatus cloudTiering() { + return this.innerProperties() == null ? null : this.innerProperties().cloudTiering(); + } + + /** + * Set the cloudTiering property: Cloud Tiering. + * + * @param cloudTiering the cloudTiering value to set. + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withCloudTiering(FeatureStatus cloudTiering) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointProperties(); + } + this.innerProperties().withCloudTiering(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointProperties(); + } + this.innerProperties().withVolumeFreeSpacePercent(volumeFreeSpacePercent); + return this; + } + + /** + * Get the tierFilesOlderThanDays property: Tier files older than days. + * + * @return the tierFilesOlderThanDays value. + */ + public Integer tierFilesOlderThanDays() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointProperties(); + } + this.innerProperties().withTierFilesOlderThanDays(tierFilesOlderThanDays); + return this; + } + + /** + * Get the friendlyName property: Friendly Name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Set the friendlyName property: Friendly Name. + * + * @param friendlyName the friendlyName value to set. + * @return the ServerEndpointInner object itself. + */ + public ServerEndpointInner withFriendlyName(String friendlyName) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointProperties(); + } + this.innerProperties().withFriendlyName(friendlyName); + return this; + } + + /** + * Get the serverResourceId property: Server Resource Id. + * + * @return the serverResourceId value. + */ + public String serverResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointProperties(); + } + this.innerProperties().withServerResourceId(serverResourceId); + return this; + } + + /** + * Get the provisioningState property: ServerEndpoint Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the lastWorkflowId property: ServerEndpoint lastWorkflowId. + * + * @return the lastWorkflowId value. + */ + public String lastWorkflowId() { + return this.innerProperties() == null ? null : this.innerProperties().lastWorkflowId(); + } + + /** + * Get the lastOperationName property: Resource Last Operation Name. + * + * @return the lastOperationName value. + */ + public String lastOperationName() { + return this.innerProperties() == null ? null : this.innerProperties().lastOperationName(); + } + + /** + * Get the syncStatus property: Server Endpoint sync status. + * + * @return the syncStatus value. + */ + public ServerEndpointSyncStatus syncStatus() { + return this.innerProperties() == null ? null : this.innerProperties().syncStatus(); + } + + /** + * Get the offlineDataTransfer property: Offline data transfer. + * + * @return the offlineDataTransfer value. + */ + public FeatureStatus offlineDataTransfer() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointProperties(); + } + this.innerProperties().withOfflineDataTransfer(offlineDataTransfer); + return this; + } + + /** + * Get the offlineDataTransferStorageAccountResourceId property: Offline data transfer storage account resource ID. + * + * @return the offlineDataTransferStorageAccountResourceId value. + */ + public String offlineDataTransferStorageAccountResourceId() { + return this.innerProperties() == null + ? null + : this.innerProperties().offlineDataTransferStorageAccountResourceId(); + } + + /** + * Get the offlineDataTransferStorageAccountTenantId property: Offline data transfer storage account tenant ID. + * + * @return the offlineDataTransferStorageAccountTenantId value. + */ + public String offlineDataTransferStorageAccountTenantId() { + return this.innerProperties() == null + ? null + : this.innerProperties().offlineDataTransferStorageAccountTenantId(); + } + + /** + * Get the offlineDataTransferShareName property: Offline data transfer share name. + * + * @return the offlineDataTransferShareName value. + */ + public String offlineDataTransferShareName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointProperties(); + } + this.innerProperties().withOfflineDataTransferShareName(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.innerProperties() == null ? null : this.innerProperties().cloudTieringStatus(); + } + + /** + * Get the recallStatus property: Recall status. Only populated if cloud tiering is enabled. + * + * @return the recallStatus value. + */ + public ServerEndpointRecallStatus recallStatus() { + return this.innerProperties() == null ? null : this.innerProperties().recallStatus(); + } + + /** + * Get the initialDownloadPolicy property: Policy for how namespace and files are recalled during FastDr. + * + * @return the initialDownloadPolicy value. + */ + public InitialDownloadPolicy initialDownloadPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointProperties(); + } + this.innerProperties().withInitialDownloadPolicy(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointProperties(); + } + this.innerProperties().withLocalCacheMode(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointProperties(); + } + this.innerProperties().withInitialUploadPolicy(initialUploadPolicy); + return this; + } + + /** + * Get the serverName property: Server name. + * + * @return the serverName value. + */ + public String serverName() { + return this.innerProperties() == null ? null : this.innerProperties().serverName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/ServerEndpointProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/ServerEndpointProperties.java new file mode 100644 index 0000000000000..6b9643a3de77b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/ServerEndpointProperties.java @@ -0,0 +1,460 @@ +// 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.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.JsonProperty; + +/** ServerEndpoint Properties object. */ +@Fluent +public final class ServerEndpointProperties { + /* + * Server Local path. + */ + @JsonProperty(value = "serverLocalPath") + private String serverLocalPath; + + /* + * Cloud Tiering. + */ + @JsonProperty(value = "cloudTiering") + private FeatureStatus cloudTiering; + + /* + * Level of free space to be maintained by Cloud Tiering if it is enabled. + */ + @JsonProperty(value = "volumeFreeSpacePercent") + private Integer volumeFreeSpacePercent; + + /* + * Tier files older than days. + */ + @JsonProperty(value = "tierFilesOlderThanDays") + private Integer tierFilesOlderThanDays; + + /* + * Friendly Name + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * Server Resource Id. + */ + @JsonProperty(value = "serverResourceId") + private String serverResourceId; + + /* + * ServerEndpoint Provisioning State + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * ServerEndpoint lastWorkflowId + */ + @JsonProperty(value = "lastWorkflowId", access = JsonProperty.Access.WRITE_ONLY) + private String lastWorkflowId; + + /* + * Resource Last Operation Name + */ + @JsonProperty(value = "lastOperationName", access = JsonProperty.Access.WRITE_ONLY) + private String lastOperationName; + + /* + * Server Endpoint sync status + */ + @JsonProperty(value = "syncStatus", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointSyncStatus syncStatus; + + /* + * Offline data transfer + */ + @JsonProperty(value = "offlineDataTransfer") + private FeatureStatus offlineDataTransfer; + + /* + * Offline data transfer storage account resource ID + */ + @JsonProperty(value = "offlineDataTransferStorageAccountResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String offlineDataTransferStorageAccountResourceId; + + /* + * Offline data transfer storage account tenant ID + */ + @JsonProperty(value = "offlineDataTransferStorageAccountTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String offlineDataTransferStorageAccountTenantId; + + /* + * Offline data transfer share name + */ + @JsonProperty(value = "offlineDataTransferShareName") + private String offlineDataTransferShareName; + + /* + * Cloud tiering status. Only populated if cloud tiering is enabled. + */ + @JsonProperty(value = "cloudTieringStatus", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointCloudTieringStatus cloudTieringStatus; + + /* + * Recall status. Only populated if cloud tiering is enabled. + */ + @JsonProperty(value = "recallStatus", access = JsonProperty.Access.WRITE_ONLY) + private ServerEndpointRecallStatus recallStatus; + + /* + * Policy for how namespace and files are recalled during FastDr. + */ + @JsonProperty(value = "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 = "localCacheMode") + private LocalCacheMode localCacheMode; + + /* + * Policy for how the initial upload sync session is performed. + */ + @JsonProperty(value = "initialUploadPolicy") + private InitialUploadPolicy initialUploadPolicy; + + /* + * Server name + */ + @JsonProperty(value = "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 ServerEndpointProperties object itself. + */ + public ServerEndpointProperties 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 ServerEndpointProperties object itself. + */ + public ServerEndpointProperties 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 ServerEndpointProperties object itself. + */ + public ServerEndpointProperties 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 ServerEndpointProperties object itself. + */ + public ServerEndpointProperties 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 ServerEndpointProperties object itself. + */ + public ServerEndpointProperties 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 ServerEndpointProperties object itself. + */ + public ServerEndpointProperties 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 ServerEndpointProperties object itself. + */ + public ServerEndpointProperties 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 ServerEndpointProperties object itself. + */ + public ServerEndpointProperties 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 ServerEndpointProperties object itself. + */ + public ServerEndpointProperties 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 ServerEndpointProperties object itself. + */ + public ServerEndpointProperties 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 ServerEndpointProperties object itself. + */ + public ServerEndpointProperties 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/ServerEndpointUpdateProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/ServerEndpointUpdateProperties.java new file mode 100644 index 0000000000000..3f654e95f4f9b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/ServerEndpointUpdateProperties.java @@ -0,0 +1,181 @@ +// 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.resourcemanager.storagesync.models.FeatureStatus; +import com.azure.resourcemanager.storagesync.models.LocalCacheMode; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ServerEndpoint Update Properties object. */ +@Fluent +public final class ServerEndpointUpdateProperties { + /* + * Cloud Tiering. + */ + @JsonProperty(value = "cloudTiering") + private FeatureStatus cloudTiering; + + /* + * Level of free space to be maintained by Cloud Tiering if it is enabled. + */ + @JsonProperty(value = "volumeFreeSpacePercent") + private Integer volumeFreeSpacePercent; + + /* + * Tier files older than days. + */ + @JsonProperty(value = "tierFilesOlderThanDays") + private Integer tierFilesOlderThanDays; + + /* + * Offline data transfer + */ + @JsonProperty(value = "offlineDataTransfer") + private FeatureStatus offlineDataTransfer; + + /* + * Offline data transfer share name + */ + @JsonProperty(value = "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 = "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 ServerEndpointUpdateProperties object itself. + */ + public ServerEndpointUpdateProperties 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 ServerEndpointUpdateProperties object itself. + */ + public ServerEndpointUpdateProperties 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 ServerEndpointUpdateProperties object itself. + */ + public ServerEndpointUpdateProperties 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 ServerEndpointUpdateProperties object itself. + */ + public ServerEndpointUpdateProperties 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 ServerEndpointUpdateProperties object itself. + */ + public ServerEndpointUpdateProperties 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 ServerEndpointUpdateProperties object itself. + */ + public ServerEndpointUpdateProperties 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/fluent/models/StorageSyncServiceCreateParametersProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/StorageSyncServiceCreateParametersProperties.java new file mode 100644 index 0000000000000..8472862ec53e5 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/StorageSyncServiceCreateParametersProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storagesync.models.IncomingTrafficPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** StorageSyncService Properties object. */ +@Fluent +public final class StorageSyncServiceCreateParametersProperties { + /* + * Incoming Traffic Policy + */ + @JsonProperty(value = "incomingTrafficPolicy") + private IncomingTrafficPolicy incomingTrafficPolicy; + + /** + * 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 StorageSyncServiceCreateParametersProperties object itself. + */ + public StorageSyncServiceCreateParametersProperties 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/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..8daf777e3831d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/StorageSyncServiceInner.java @@ -0,0 +1,134 @@ +// 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.management.Resource; +import com.azure.resourcemanager.storagesync.models.IncomingTrafficPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Storage Sync Service object. */ +@Fluent +public final class StorageSyncServiceInner extends Resource { + /* + * Storage Sync Service properties. + */ + @JsonProperty(value = "properties") + private StorageSyncServiceProperties innerProperties; + + /** + * Get the innerProperties property: Storage Sync Service properties. + * + * @return the innerProperties value. + */ + private StorageSyncServiceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public StorageSyncServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public StorageSyncServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the incomingTrafficPolicy property: Incoming Traffic Policy. + * + * @return the incomingTrafficPolicy value. + */ + public IncomingTrafficPolicy incomingTrafficPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageSyncServiceProperties(); + } + this.innerProperties().withIncomingTrafficPolicy(incomingTrafficPolicy); + return this; + } + + /** + * Get the storageSyncServiceStatus property: Storage Sync service status. + * + * @return the storageSyncServiceStatus value. + */ + public Integer storageSyncServiceStatus() { + return this.innerProperties() == null ? null : this.innerProperties().storageSyncServiceStatus(); + } + + /** + * Get the storageSyncServiceUid property: Storage Sync service Uid. + * + * @return the storageSyncServiceUid value. + */ + public String storageSyncServiceUid() { + return this.innerProperties() == null ? null : this.innerProperties().storageSyncServiceUid(); + } + + /** + * Get the provisioningState property: StorageSyncService Provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the lastWorkflowId property: StorageSyncService lastWorkflowId. + * + * @return the lastWorkflowId value. + */ + public String lastWorkflowId() { + return this.innerProperties() == null ? null : this.innerProperties().lastWorkflowId(); + } + + /** + * Get the lastOperationName property: Resource Last Operation Name. + * + * @return the lastOperationName value. + */ + public String lastOperationName() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/StorageSyncServiceProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/StorageSyncServiceProperties.java new file mode 100644 index 0000000000000..786caed130155 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/StorageSyncServiceProperties.java @@ -0,0 +1,142 @@ +// 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.resourcemanager.storagesync.models.IncomingTrafficPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Storage Sync Service Properties object. */ +@Fluent +public final class StorageSyncServiceProperties { + /* + * Incoming Traffic Policy + */ + @JsonProperty(value = "incomingTrafficPolicy") + private IncomingTrafficPolicy incomingTrafficPolicy; + + /* + * Storage Sync service status. + */ + @JsonProperty(value = "storageSyncServiceStatus", access = JsonProperty.Access.WRITE_ONLY) + private Integer storageSyncServiceStatus; + + /* + * Storage Sync service Uid + */ + @JsonProperty(value = "storageSyncServiceUid", access = JsonProperty.Access.WRITE_ONLY) + private String storageSyncServiceUid; + + /* + * StorageSyncService Provisioning State + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * StorageSyncService lastWorkflowId + */ + @JsonProperty(value = "lastWorkflowId", access = JsonProperty.Access.WRITE_ONLY) + private String lastWorkflowId; + + /* + * Resource Last Operation Name + */ + @JsonProperty(value = "lastOperationName", access = JsonProperty.Access.WRITE_ONLY) + private String lastOperationName; + + /* + * List of private endpoint connection associated with the specified storage sync service + */ + @JsonProperty(value = "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 StorageSyncServiceProperties object itself. + */ + public StorageSyncServiceProperties 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; + } + + /** + * 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/StorageSyncServiceUpdateProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/StorageSyncServiceUpdateProperties.java new file mode 100644 index 0000000000000..1a07e860550ee --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/StorageSyncServiceUpdateProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storagesync.models.IncomingTrafficPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** StorageSyncService Properties object. */ +@Fluent +public final class StorageSyncServiceUpdateProperties { + /* + * Incoming Traffic Policy + */ + @JsonProperty(value = "incomingTrafficPolicy") + private IncomingTrafficPolicy incomingTrafficPolicy; + + /** + * 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 StorageSyncServiceUpdateProperties object itself. + */ + public StorageSyncServiceUpdateProperties 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/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..05325d12be160 --- /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.Fluent; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Sync Group object. */ +@Fluent +public final class SyncGroupInner extends ProxyResource { + /* + * SyncGroup properties. + */ + @JsonProperty(value = "properties") + private SyncGroupProperties innerProperties; + + /** + * Get the innerProperties property: SyncGroup properties. + * + * @return the innerProperties value. + */ + private SyncGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the uniqueId property: Unique Id. + * + * @return the uniqueId value. + */ + public String uniqueId() { + return this.innerProperties() == null ? null : this.innerProperties().uniqueId(); + } + + /** + * Get the syncGroupStatus property: Sync group status. + * + * @return the syncGroupStatus value. + */ + public String syncGroupStatus() { + return this.innerProperties() == null ? null : this.innerProperties().syncGroupStatus(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/SyncGroupProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/SyncGroupProperties.java new file mode 100644 index 0000000000000..957eb24853ba8 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/SyncGroupProperties.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SyncGroup Properties object. */ +@Immutable +public final class SyncGroupProperties { + /* + * Unique Id + */ + @JsonProperty(value = "uniqueId", access = JsonProperty.Access.WRITE_ONLY) + private String uniqueId; + + /* + * Sync group status + */ + @JsonProperty(value = "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..69fc255e67267 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/WorkflowInner.java @@ -0,0 +1,200 @@ +// 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.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.storagesync.models.OperationDirection; +import com.azure.resourcemanager.storagesync.models.WorkflowStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Workflow resource. */ +@Fluent +public final class WorkflowInner extends ProxyResource { + /* + * Workflow properties. + */ + @JsonProperty(value = "properties") + private WorkflowProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Workflow properties. + * + * @return the innerProperties value. + */ + private WorkflowProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the lastStepName property: last step name. + * + * @return the lastStepName value. + */ + public String lastStepName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkflowProperties(); + } + this.innerProperties().withLastStepName(lastStepName); + return this; + } + + /** + * Get the status property: workflow status. + * + * @return the status value. + */ + public WorkflowStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: workflow status. + * + * @param status the status value to set. + * @return the WorkflowInner object itself. + */ + public WorkflowInner withStatus(WorkflowStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkflowProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the operation property: operation direction. + * + * @return the operation value. + */ + public OperationDirection operation() { + return this.innerProperties() == null ? null : this.innerProperties().operation(); + } + + /** + * Set the operation property: operation direction. + * + * @param operation the operation value to set. + * @return the WorkflowInner object itself. + */ + public WorkflowInner withOperation(OperationDirection operation) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkflowProperties(); + } + this.innerProperties().withOperation(operation); + return this; + } + + /** + * Get the steps property: workflow steps. + * + * @return the steps value. + */ + public String steps() { + return this.innerProperties() == null ? null : this.innerProperties().steps(); + } + + /** + * Set the steps property: workflow steps. + * + * @param steps the steps value to set. + * @return the WorkflowInner object itself. + */ + public WorkflowInner withSteps(String steps) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkflowProperties(); + } + this.innerProperties().withSteps(steps); + return this; + } + + /** + * Get the lastOperationId property: workflow last operation identifier. + * + * @return the lastOperationId value. + */ + public String lastOperationId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkflowProperties(); + } + this.innerProperties().withLastOperationId(lastOperationId); + return this; + } + + /** + * Get the commandName property: workflow command name. + * + * @return the commandName value. + */ + public String commandName() { + return this.innerProperties() == null ? null : this.innerProperties().commandName(); + } + + /** + * Get the createdTimestamp property: workflow created timestamp. + * + * @return the createdTimestamp value. + */ + public OffsetDateTime createdTimestamp() { + return this.innerProperties() == null ? null : this.innerProperties().createdTimestamp(); + } + + /** + * Get the lastStatusTimestamp property: workflow last status timestamp. + * + * @return the lastStatusTimestamp value. + */ + public OffsetDateTime lastStatusTimestamp() { + return this.innerProperties() == null ? null : this.innerProperties().lastStatusTimestamp(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/WorkflowProperties.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/WorkflowProperties.java new file mode 100644 index 0000000000000..c4e287b5d4892 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/fluent/models/WorkflowProperties.java @@ -0,0 +1,198 @@ +// 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.resourcemanager.storagesync.models.OperationDirection; +import com.azure.resourcemanager.storagesync.models.WorkflowStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Workflow Properties object. */ +@Fluent +public final class WorkflowProperties { + /* + * last step name + */ + @JsonProperty(value = "lastStepName") + private String lastStepName; + + /* + * workflow status. + */ + @JsonProperty(value = "status") + private WorkflowStatus status; + + /* + * operation direction. + */ + @JsonProperty(value = "operation") + private OperationDirection operation; + + /* + * workflow steps + */ + @JsonProperty(value = "steps") + private String steps; + + /* + * workflow last operation identifier. + */ + @JsonProperty(value = "lastOperationId") + private String lastOperationId; + + /* + * workflow command name. + */ + @JsonProperty(value = "commandName", access = JsonProperty.Access.WRITE_ONLY) + private String commandName; + + /* + * workflow created timestamp. + */ + @JsonProperty(value = "createdTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTimestamp; + + /* + * workflow last status timestamp. + */ + @JsonProperty(value = "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 WorkflowProperties object itself. + */ + public WorkflowProperties 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 WorkflowProperties object itself. + */ + public WorkflowProperties 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 WorkflowProperties object itself. + */ + public WorkflowProperties 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 WorkflowProperties object itself. + */ + public WorkflowProperties 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 WorkflowProperties object itself. + */ + public WorkflowProperties 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/CloudEndpointAfsShareMetadataCertificatePublicKeysImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointAfsShareMetadataCertificatePublicKeysImpl.java new file mode 100644 index 0000000000000..29274ddb651c8 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointAfsShareMetadataCertificatePublicKeysImpl.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.implementation; + +import com.azure.resourcemanager.storagesync.fluent.models.CloudEndpointAfsShareMetadataCertificatePublicKeysInner; +import com.azure.resourcemanager.storagesync.models.CloudEndpointAfsShareMetadataCertificatePublicKeys; + +public final class CloudEndpointAfsShareMetadataCertificatePublicKeysImpl + implements CloudEndpointAfsShareMetadataCertificatePublicKeys { + private CloudEndpointAfsShareMetadataCertificatePublicKeysInner innerObject; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + CloudEndpointAfsShareMetadataCertificatePublicKeysImpl( + CloudEndpointAfsShareMetadataCertificatePublicKeysInner innerObject, + com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String firstKey() { + return this.innerModel().firstKey(); + } + + public String secondKey() { + return this.innerModel().secondKey(); + } + + public CloudEndpointAfsShareMetadataCertificatePublicKeysInner 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..37fcf70634745 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointImpl.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.management.SystemData; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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..314e5c9a886cb --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointsClientImpl.java @@ -0,0 +1,3519 @@ +// 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.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storagesync.fluent.CloudEndpointsClient; +import com.azure.resourcemanager.storagesync.fluent.models.CloudEndpointAfsShareMetadataCertificatePublicKeysInner; +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.CloudEndpointsAfsShareMetadataCertificatePublicKeysResponse; +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 { + /** 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); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageSync" + + "/storageSyncServices/{storageSyncServiceName}/syncGroups/{syncGroupName}/cloudEndpoints" + + "/{cloudEndpointName}/afsShareMetadataCertificatePublicKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono afsShareMetadataCertificatePublicKeys( + @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); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 the {@link PollerFlux} for polling of cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of cloud Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 the {@link PollerFlux} for polling of post Backup Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of post Backup Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of post Backup Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of post Backup Response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restoreheartbeatAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return restoreheartbeatWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName) + .flatMap(ignored -> 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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(); + } + + /** + * Get the AFS file share metadata signing certificate public keys. + * + * @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 AFS file share metadata signing certificate public keys on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + afsShareMetadataCertificatePublicKeysWithResponseAsync( + 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 + .afsShareMetadataCertificatePublicKeys( + 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 the AFS file share metadata signing certificate public keys. + * + * @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 AFS file share metadata signing certificate public keys on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono + afsShareMetadataCertificatePublicKeysWithResponseAsync( + 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 + .afsShareMetadataCertificatePublicKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + storageSyncServiceName, + syncGroupName, + cloudEndpointName, + accept, + context); + } + + /** + * Get the AFS file share metadata signing certificate public keys. + * + * @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 AFS file share metadata signing certificate public keys on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono afsShareMetadataCertificatePublicKeysAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return afsShareMetadataCertificatePublicKeysWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the AFS file share metadata signing certificate public keys. + * + * @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 AFS file share metadata signing certificate public keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudEndpointAfsShareMetadataCertificatePublicKeysInner afsShareMetadataCertificatePublicKeys( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + return afsShareMetadataCertificatePublicKeysAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName) + .block(); + } + + /** + * Get the AFS file share metadata signing certificate public keys. + * + * @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 AFS file share metadata signing certificate public keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudEndpointsAfsShareMetadataCertificatePublicKeysResponse + afsShareMetadataCertificatePublicKeysWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context) { + return afsShareMetadataCertificatePublicKeysWithResponseAsync( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, 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..d6dbfccc26169 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/CloudEndpointsImpl.java @@ -0,0 +1,450 @@ +// 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.CloudEndpointAfsShareMetadataCertificatePublicKeysInner; +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.CloudEndpointAfsShareMetadataCertificatePublicKeys; +import com.azure.resourcemanager.storagesync.models.CloudEndpoints; +import com.azure.resourcemanager.storagesync.models.CloudEndpointsAfsShareMetadataCertificatePublicKeysResponse; +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; + +public final class CloudEndpointsImpl implements CloudEndpoints { + private static 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 CloudEndpointAfsShareMetadataCertificatePublicKeys afsShareMetadataCertificatePublicKeys( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName) { + CloudEndpointAfsShareMetadataCertificatePublicKeysInner inner = + this + .serviceClient() + .afsShareMetadataCertificatePublicKeys( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName); + if (inner != null) { + return new CloudEndpointAfsShareMetadataCertificatePublicKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response + afsShareMetadataCertificatePublicKeysWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + Context context) { + CloudEndpointsAfsShareMetadataCertificatePublicKeysResponse inner = + this + .serviceClient() + .afsShareMetadataCertificatePublicKeysWithResponse( + resourceGroupName, storageSyncServiceName, syncGroupName, cloudEndpointName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CloudEndpointAfsShareMetadataCertificatePublicKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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/LocationOperationStatusImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/LocationOperationStatusImpl.java new file mode 100644 index 0000000000000..11bfed83dc7de --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/LocationOperationStatusImpl.java @@ -0,0 +1,59 @@ +// 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.LocationOperationStatusInner; +import com.azure.resourcemanager.storagesync.models.LocationOperationStatus; +import com.azure.resourcemanager.storagesync.models.StorageSyncApiError; +import java.time.OffsetDateTime; + +public final class LocationOperationStatusImpl implements LocationOperationStatus { + private LocationOperationStatusInner innerObject; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + LocationOperationStatusImpl( + LocationOperationStatusInner 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 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 Integer percentComplete() { + return this.innerModel().percentComplete(); + } + + public LocationOperationStatusInner 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/MicrosoftStorageSyncBuilder.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/MicrosoftStorageSyncBuilder.java new file mode 100644 index 0000000000000..4a9e9b0f2cc7d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/MicrosoftStorageSyncBuilder.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.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the 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 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 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 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() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + MicrosoftStorageSyncImpl client = + new MicrosoftStorageSyncImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + 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..3c53e5f873964 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/MicrosoftStorageSyncImpl.java @@ -0,0 +1,430 @@ +// 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.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.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.ResourceProvidersClient; +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 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 { + /** 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; + } + + /** The ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** + * 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 = "2022-06-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); + this.resourceProviders = new ResourceProvidersClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MicrosoftStorageSyncImpl.class); +} 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..abfc1e8c0811c --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationStatusOperationsClientImpl.java @@ -0,0 +1,243 @@ +// 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.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 { + /** 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String locationName, String workflowId, String operationId) { + return getWithResponseAsync(resourceGroupName, locationName, workflowId, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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..a86fb3276f89d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationStatusOperationsImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +public final class OperationStatusOperationsImpl implements OperationStatusOperations { + private static 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..7cd10e17fb68f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationsClientImpl.java @@ -0,0 +1,272 @@ +// 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.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 { + /** 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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + 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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available 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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + res.getDeserializedHeaders())) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + 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..cc5d1f6dd0e02 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/OperationsImpl.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.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; + +public final class OperationsImpl implements Operations { + private static 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..f37398cbed8b2 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,142 @@ +// 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.SystemData; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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..45a40cb885e21 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1152 @@ +// 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.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 { + /** 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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String storageSyncServiceName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link + * Response}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 {@link PollerFlux} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of the Private Endpoint Connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..84bc7060dd099 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,225 @@ +// 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; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static 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..6ac4ae0134e9d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateLinkResourcesClientImpl.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.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.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 { + /** 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 along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 along with {@link Response} + * on successful completion of {@link Mono}. + */ + @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 on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByStorageSyncServiceAsync( + String resourceGroupName, String storageSyncServiceName) { + return listByStorageSyncServiceWithResponseAsync(resourceGroupName, storageSyncServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link + * Response}. + */ + @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..958e6c498d60d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + private static 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..a8d245e477d59 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/RegisteredServerImpl.java @@ -0,0 +1,259 @@ +// 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.SystemData; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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..baca683fbb88e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/RegisteredServersClientImpl.java @@ -0,0 +1,1382 @@ +// 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.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 { + /** 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String storageSyncServiceName, String serverId) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, serverId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 the {@link PollerFlux} for polling of registered Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of registered Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of registered Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of registered Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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..cca42fe0e60d1 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/RegisteredServersImpl.java @@ -0,0 +1,223 @@ +// 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; + +public final class RegisteredServersImpl implements RegisteredServers { + private static 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/ResourceProvidersClientImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 0000000000000..40eed72f5f98e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,209 @@ +// 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.resourcemanager.storagesync.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.storagesync.fluent.models.LocationOperationStatusInner; +import com.azure.resourcemanager.storagesync.models.ResourceProvidersLocationOperationStatusResponse; +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 ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final MicrosoftStorageSyncImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(MicrosoftStorageSyncImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftStorageSyncResourceProviders to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftStorageSync") + private interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.StorageSync/locations/{locationName}/operations" + + "/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(StorageSyncApiErrorException.class) + Mono locationOperationStatus( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("locationName") String locationName, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get Operation status. + * + * @param locationName The desired region to obtain information from. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono locationOperationStatusWithResponseAsync( + String locationName, 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 (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName 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 + .locationOperationStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + locationName, + operationId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Operation status. + * + * @param locationName The desired region to obtain information from. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono locationOperationStatusWithResponseAsync( + String locationName, 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 (locationName == null) { + return Mono.error(new IllegalArgumentException("Parameter locationName 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 + .locationOperationStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + locationName, + operationId, + accept, + context); + } + + /** + * Get Operation status. + * + * @param locationName The desired region to obtain information from. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono locationOperationStatusAsync(String locationName, String operationId) { + return locationOperationStatusWithResponseAsync(locationName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Operation status. + * + * @param locationName The desired region to obtain information from. + * @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 LocationOperationStatusInner locationOperationStatus(String locationName, String operationId) { + return locationOperationStatusAsync(locationName, operationId).block(); + } + + /** + * Get Operation status. + * + * @param locationName The desired region to obtain information from. + * @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 ResourceProvidersLocationOperationStatusResponse locationOperationStatusWithResponse( + String locationName, String operationId, Context context) { + return locationOperationStatusWithResponseAsync(locationName, operationId, context).block(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ResourceProvidersImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ResourceProvidersImpl.java new file mode 100644 index 0000000000000..1609229e4520c --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ResourceProvidersImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.ResourceProvidersClient; +import com.azure.resourcemanager.storagesync.fluent.models.LocationOperationStatusInner; +import com.azure.resourcemanager.storagesync.models.LocationOperationStatus; +import com.azure.resourcemanager.storagesync.models.ResourceProviders; +import com.azure.resourcemanager.storagesync.models.ResourceProvidersLocationOperationStatusResponse; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, com.azure.resourcemanager.storagesync.StoragesyncManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public LocationOperationStatus locationOperationStatus(String locationName, String operationId) { + LocationOperationStatusInner inner = this.serviceClient().locationOperationStatus(locationName, operationId); + if (inner != null) { + return new LocationOperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response locationOperationStatusWithResponse( + String locationName, String operationId, Context context) { + ResourceProvidersLocationOperationStatusResponse inner = + this.serviceClient().locationOperationStatusWithResponse(locationName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LocationOperationStatusImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ResourceProvidersClient 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/ServerEndpointImpl.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointImpl.java new file mode 100644 index 0000000000000..19cb75bb43d45 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointImpl.java @@ -0,0 +1,359 @@ +// 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.SystemData; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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 String resourceGroupName() { + return resourceGroupName; + } + + 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..41c338f74edf5 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointsClientImpl.java @@ -0,0 +1,1996 @@ +// 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.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 { + /** 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 the {@link PollerFlux} for polling of server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 the {@link PollerFlux} for polling of server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of server Endpoint object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String serverEndpointName) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, serverEndpointName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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..45f7353d94a74 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/ServerEndpointsImpl.java @@ -0,0 +1,276 @@ +// 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; + +public final class ServerEndpointsImpl implements ServerEndpoints { + private static 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..0cabdcdec4fa9 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/StorageSyncServiceImpl.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 String resourceGroupName() { + return resourceGroupName; + } + + 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..5fd948b7ed03e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/StorageSyncServicesClientImpl.java @@ -0,0 +1,1621 @@ +// 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.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 { + /** 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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String locationName, CheckNameAvailabilityParameters parameters) { + return checkNameAvailabilityWithResponseAsync(locationName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 the {@link PollerFlux} for polling of storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String storageSyncServiceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, storageSyncServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 the {@link PollerFlux} for polling of storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of storage Sync Service object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + 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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..6ffba9c9757a4 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/StorageSyncServicesImpl.java @@ -0,0 +1,209 @@ +// 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; + +public final class StorageSyncServicesImpl implements StorageSyncServices { + private static 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..860ab12ac1691 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/SyncGroupsClientImpl.java @@ -0,0 +1,827 @@ +// 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.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 { + /** 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + SyncGroupCreateParameters parameters) { + return createWithResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String storageSyncServiceName, String syncGroupName) { + return deleteWithResponseAsync(resourceGroupName, storageSyncServiceName, syncGroupName) + .flatMap(ignored -> 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..fd07988b05d5f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/SyncGroupsImpl.java @@ -0,0 +1,203 @@ +// 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; + +public final class SyncGroupsImpl implements SyncGroups { + private static 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); + } + + 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..544196387029a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/WorkflowImpl.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.implementation; + +import com.azure.core.management.SystemData; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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..f26c37d5eff0d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/WorkflowsClientImpl.java @@ -0,0 +1,609 @@ +// 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.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 { + /** 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String storageSyncServiceName, String workflowId) { + return getWithResponseAsync(resourceGroupName, storageSyncServiceName, workflowId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono abortAsync(String resourceGroupName, String storageSyncServiceName, String workflowId) { + return abortWithResponseAsync(resourceGroupName, storageSyncServiceName, workflowId) + .flatMap(ignored -> 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..cdd89a67dee02 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/implementation/WorkflowsImpl.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +public final class WorkflowsImpl implements Workflows { + private static 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..b65ae6679c9bc --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/BackupRequest.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Backup request. */ +@Fluent +public final class BackupRequest { + /* + * 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..4fd96e3a8b31b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ChangeDetectionMode.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; + +/** Change Detection Mode. Applies to a directory specified in directoryPath parameter. */ +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); + } + + /** + * Gets known ChangeDetectionMode values. + * + * @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..5c80778e85140 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CheckNameAvailabilityParameters.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters for a check name availability request. */ +@Fluent +public final class CheckNameAvailabilityParameters { + /* + * 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 = "Microsoft.StorageSync/storageSyncServices"; + + /** 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailabilityParameters.class); +} 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..5d7bf33218497 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpoint.java @@ -0,0 +1,359 @@ +// 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.SystemData; +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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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/CloudEndpointAfsShareMetadataCertificatePublicKeys.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointAfsShareMetadataCertificatePublicKeys.java new file mode 100644 index 0000000000000..13d468ee1a37b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointAfsShareMetadataCertificatePublicKeys.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.resourcemanager.storagesync.fluent.models.CloudEndpointAfsShareMetadataCertificatePublicKeysInner; + +/** An immutable client-side representation of CloudEndpointAfsShareMetadataCertificatePublicKeys. */ +public interface CloudEndpointAfsShareMetadataCertificatePublicKeys { + /** + * Gets the firstKey property: The first public key. + * + * @return the firstKey value. + */ + String firstKey(); + + /** + * Gets the secondKey property: The second public key. + * + * @return the secondKey value. + */ + String secondKey(); + + /** + * Gets the inner + * com.azure.resourcemanager.storagesync.fluent.models.CloudEndpointAfsShareMetadataCertificatePublicKeysInner + * object. + * + * @return the inner object. + */ + CloudEndpointAfsShareMetadataCertificatePublicKeysInner innerModel(); +} 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..40b9de30935c8 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointArray.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.resourcemanager.storagesync.fluent.models.CloudEndpointInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Array of CloudEndpoint. */ +@Fluent +public final class CloudEndpointArray { + /* + * 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..192ca21e1524d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationActivity.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Cloud endpoint change enumeration activity object. */ +@Immutable +public final class CloudEndpointChangeEnumerationActivity { + /* + * 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..6a4a16ec429ef --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationActivityState.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; + +/** State of change enumeration activity. */ +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); + } + + /** + * Gets known CloudEndpointChangeEnumerationActivityState values. + * + * @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..a4771b087d6b8 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationStatus.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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Cloud endpoint change enumeration status object. */ +@Immutable +public final class CloudEndpointChangeEnumerationStatus { + /* + * 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..2704ad4885af7 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointChangeEnumerationTotalCountsState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the total counts of change enumeration activity. */ +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); + } + + /** + * Gets known CloudEndpointChangeEnumerationTotalCountsState values. + * + * @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..779c90f5eab20 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointCreateParameters.java @@ -0,0 +1,148 @@ +// 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.management.SystemData; +import com.azure.resourcemanager.storagesync.fluent.models.CloudEndpointCreateParametersProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used when creating a cloud endpoint. */ +@Fluent +public final class CloudEndpointCreateParameters extends ProxyResource { + /* + * The parameters used to create the cloud endpoint. + */ + @JsonProperty(value = "properties") + private CloudEndpointCreateParametersProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The parameters used to create the cloud endpoint. + * + * @return the innerProperties value. + */ + private CloudEndpointCreateParametersProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the storageAccountResourceId property: Storage Account Resource Id. + * + * @return the storageAccountResourceId value. + */ + public String storageAccountResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudEndpointCreateParametersProperties(); + } + this.innerProperties().withStorageAccountResourceId(storageAccountResourceId); + return this; + } + + /** + * Get the azureFileShareName property: Azure file share name. + * + * @return the azureFileShareName value. + */ + public String azureFileShareName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudEndpointCreateParametersProperties(); + } + this.innerProperties().withAzureFileShareName(azureFileShareName); + return this; + } + + /** + * Get the storageAccountTenantId property: Storage Account Tenant Id. + * + * @return the storageAccountTenantId value. + */ + public String storageAccountTenantId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudEndpointCreateParametersProperties(); + } + this.innerProperties().withStorageAccountTenantId(storageAccountTenantId); + return this; + } + + /** + * Get the friendlyName property: Friendly Name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Set the friendlyName property: Friendly Name. + * + * @param friendlyName the friendlyName value to set. + * @return the CloudEndpointCreateParameters object itself. + */ + public CloudEndpointCreateParameters withFriendlyName(String friendlyName) { + if (this.innerProperties() == null) { + this.innerProperties = new CloudEndpointCreateParametersProperties(); + } + this.innerProperties().withFriendlyName(friendlyName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/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..d08ce527f3343 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointLastChangeEnumerationStatus.java @@ -0,0 +1,111 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Cloud endpoint change enumeration status object. */ +@Immutable +public final class CloudEndpointLastChangeEnumerationStatus { + /* + * 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..80840a5f8f5b4 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpoints.java @@ -0,0 +1,458 @@ +// 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 the AFS file share metadata signing certificate public keys. + * + * @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 AFS file share metadata signing certificate public keys. + */ + CloudEndpointAfsShareMetadataCertificatePublicKeys afsShareMetadataCertificatePublicKeys( + String resourceGroupName, String storageSyncServiceName, String syncGroupName, String cloudEndpointName); + + /** + * Get the AFS file share metadata signing certificate public keys. + * + * @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 AFS file share metadata signing certificate public keys. + */ + Response afsShareMetadataCertificatePublicKeysWithResponse( + String resourceGroupName, + String storageSyncServiceName, + String syncGroupName, + String cloudEndpointName, + 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/CloudEndpointsAfsShareMetadataCertificatePublicKeysHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsAfsShareMetadataCertificatePublicKeysHeaders.java new file mode 100644 index 0000000000000..d1b21ad853a5c --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsAfsShareMetadataCertificatePublicKeysHeaders.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudEndpointsAfsShareMetadataCertificatePublicKeysHeaders model. */ +@Fluent +public final class CloudEndpointsAfsShareMetadataCertificatePublicKeysHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of CloudEndpointsAfsShareMetadataCertificatePublicKeysHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public CloudEndpointsAfsShareMetadataCertificatePublicKeysHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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 CloudEndpointsAfsShareMetadataCertificatePublicKeysHeaders object itself. + */ + public CloudEndpointsAfsShareMetadataCertificatePublicKeysHeaders 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 CloudEndpointsAfsShareMetadataCertificatePublicKeysHeaders object itself. + */ + public CloudEndpointsAfsShareMetadataCertificatePublicKeysHeaders 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/CloudEndpointsAfsShareMetadataCertificatePublicKeysResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsAfsShareMetadataCertificatePublicKeysResponse.java new file mode 100644 index 0000000000000..f6640de3e9d3e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsAfsShareMetadataCertificatePublicKeysResponse.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.CloudEndpointAfsShareMetadataCertificatePublicKeysInner; + +/** Contains all response data for the afsShareMetadataCertificatePublicKeys operation. */ +public final class CloudEndpointsAfsShareMetadataCertificatePublicKeysResponse + extends ResponseBase< + CloudEndpointsAfsShareMetadataCertificatePublicKeysHeaders, + CloudEndpointAfsShareMetadataCertificatePublicKeysInner> { + /** + * Creates an instance of CloudEndpointsAfsShareMetadataCertificatePublicKeysResponse. + * + * @param request the request which resulted in this CloudEndpointsAfsShareMetadataCertificatePublicKeysResponse. + * @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 CloudEndpointsAfsShareMetadataCertificatePublicKeysResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + CloudEndpointAfsShareMetadataCertificatePublicKeysInner value, + CloudEndpointsAfsShareMetadataCertificatePublicKeysHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public CloudEndpointAfsShareMetadataCertificatePublicKeysInner getValue() { + return super.getValue(); + } +} 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..eeeaa586b681e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsGetHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudEndpointsGetHeaders model. */ +@Fluent +public final class CloudEndpointsGetHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of CloudEndpointsGetHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public CloudEndpointsGetHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..aa85420a1bdac --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsGetResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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..da42e3c4eeb00 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsListBySyncGroupHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudEndpointsListBySyncGroupHeaders model. */ +@Fluent +public final class CloudEndpointsListBySyncGroupHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of CloudEndpointsListBySyncGroupHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public CloudEndpointsListBySyncGroupHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..bcde1cfc28fc6 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsListBySyncGroupResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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/CloudEndpointsRestoreheartbeatHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsRestoreheartbeatHeaders.java new file mode 100644 index 0000000000000..fa0f78d0e7e2f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudEndpointsRestoreheartbeatHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The CloudEndpointsRestoreheartbeatHeaders model. */ +@Fluent +public final class CloudEndpointsRestoreheartbeatHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of CloudEndpointsRestoreheartbeatHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public CloudEndpointsRestoreheartbeatHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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/CloudTieringCachePerformance.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringCachePerformance.java new file mode 100644 index 0000000000000..aea50bce4479e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringCachePerformance.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Server endpoint cloud tiering status object. */ +@Immutable +public final class CloudTieringCachePerformance { + /* + * 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..91f7f14205f4b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringDatePolicyStatus.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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Status of the date policy. */ +@Immutable +public final class CloudTieringDatePolicyStatus { + /* + * 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..dc94c56725540 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringFilesNotTiering.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +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 { + /* + * 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/CloudTieringLowDiskMode.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringLowDiskMode.java new file mode 100644 index 0000000000000..7a6adf81d9085 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringLowDiskMode.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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Information regarding the low disk mode state. */ +@Immutable +public final class CloudTieringLowDiskMode { + /* + * Last updated timestamp + */ + @JsonProperty(value = "lastUpdatedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTimestamp; + + /* + * Low disk mode state + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private CloudTieringLowDiskModeState state; + + /** + * Get the lastUpdatedTimestamp property: Last updated timestamp. + * + * @return the lastUpdatedTimestamp value. + */ + public OffsetDateTime lastUpdatedTimestamp() { + return this.lastUpdatedTimestamp; + } + + /** + * Get the state property: Low disk mode state. + * + * @return the state value. + */ + public CloudTieringLowDiskModeState state() { + return this.state; + } + + /** + * 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/CloudTieringLowDiskModeState.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringLowDiskModeState.java new file mode 100644 index 0000000000000..fb846455d65fa --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringLowDiskModeState.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; + +/** Type of the cloud tiering low disk mode state. */ +public final class CloudTieringLowDiskModeState extends ExpandableStringEnum { + /** Static value Enabled for CloudTieringLowDiskModeState. */ + public static final CloudTieringLowDiskModeState ENABLED = fromString("Enabled"); + + /** Static value Disabled for CloudTieringLowDiskModeState. */ + public static final CloudTieringLowDiskModeState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a CloudTieringLowDiskModeState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CloudTieringLowDiskModeState. + */ + @JsonCreator + public static CloudTieringLowDiskModeState fromString(String name) { + return fromString(name, CloudTieringLowDiskModeState.class); + } + + /** + * Gets known CloudTieringLowDiskModeState values. + * + * @return known CloudTieringLowDiskModeState values. + */ + public static Collection values() { + return values(CloudTieringLowDiskModeState.class); + } +} 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..ff45ac21991cf --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringSpaceSavings.java @@ -0,0 +1,111 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Server endpoint cloud tiering status object. */ +@Immutable +public final class CloudTieringSpaceSavings { + /* + * 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..cc3631076615a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/CloudTieringVolumeFreeSpacePolicyStatus.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Status of the volume free space policy. */ +@Immutable +public final class CloudTieringVolumeFreeSpacePolicyStatus { + /* + * 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..b63645c477d30 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/FeatureStatus.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; + +/** Type of the Feature Status. */ +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); + } + + /** + * Gets known FeatureStatus values. + * + * @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..eb5385fffc17e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/FilesNotTieringError.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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Files not tiering error object. */ +@Immutable +public final class FilesNotTieringError { + /* + * 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..2215690858001 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/IncomingTrafficPolicy.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; + +/** Type of the Incoming Traffic Policy. */ +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); + } + + /** + * Gets known IncomingTrafficPolicy values. + * + * @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..a5f63204edcd9 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/InitialDownloadPolicy.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; + +/** Policy for how namespace and files are recalled during FastDr. */ +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); + } + + /** + * Gets known InitialDownloadPolicy values. + * + * @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..ce830b80f35d6 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/InitialUploadPolicy.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; + +/** Policy for how the initial upload sync session is performed. */ +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); + } + + /** + * Gets known InitialUploadPolicy values. + * + * @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..58041da188acf --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/LocalCacheMode.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; + +/** + * Policy for enabling follow-the-sun business models: link local cache to cloud behavior to pre-populate before local + * access. + */ +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); + } + + /** + * Gets known LocalCacheMode values. + * + * @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/LocationOperationStatus.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/LocationOperationStatus.java new file mode 100644 index 0000000000000..2b3e77d7a166c --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/LocationOperationStatus.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.resourcemanager.storagesync.fluent.models.LocationOperationStatusInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of LocationOperationStatus. */ +public interface LocationOperationStatus { + /** + * Gets the id property: Operation resource Id. + * + * @return the id value. + */ + String id(); + + /** + * 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 percentComplete property: Percent complete. + * + * @return the percentComplete value. + */ + Integer percentComplete(); + + /** + * Gets the inner com.azure.resourcemanager.storagesync.fluent.models.LocationOperationStatusInner object. + * + * @return the inner object. + */ + LocationOperationStatusInner innerModel(); +} 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..853fa6d423722 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/NameAvailabilityReason.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets the reason that a Storage Sync Service name could not be used. The Reason element is only returned if + * NameAvailable is false. + */ +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) { + if (value == null) { + return null; + } + NameAvailabilityReason[] items = NameAvailabilityReason.values(); + for (NameAvailabilityReason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @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..8b912592290e2 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationDirection.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; + +/** Type of the Operation Direction. */ +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); + } + + /** + * Gets known OperationDirection values. + * + * @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..38983514de18b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationDisplayInfo.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The operation supported by storage sync. */ +@Fluent +public final class OperationDisplayInfo { + /* + * 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..6d509c8d3a75f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationEntityListResult.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.resourcemanager.storagesync.fluent.models.OperationEntityInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of storage sync operations. */ +@Fluent +public final class OperationEntityListResult { + /* + * 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..3749104b7256e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationProperties.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the operations resource. */ +@Fluent +public final class OperationProperties { + /* + * 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..31c7a4a77362c --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationResourceMetricSpecification.java @@ -0,0 +1,233 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Operation Display Resource object. */ +@Fluent +public final class OperationResourceMetricSpecification { + /* + * 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; + + /* + * Supported aggregation types for the metric. + */ + @JsonProperty(value = "supportedAggregationTypes") + private List supportedAggregationTypes; + + /* + * 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 supportedAggregationTypes property: Supported aggregation types for the metric. + * + * @return the supportedAggregationTypes value. + */ + public List supportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set the supportedAggregationTypes property: Supported aggregation types for the metric. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set. + * @return the OperationResourceMetricSpecification object itself. + */ + public OperationResourceMetricSpecification withSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + 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..b3ba50ca7ae71 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationResourceMetricSpecificationDimension.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** OperationResourceMetricSpecificationDimension object. */ +@Fluent +public final class OperationResourceMetricSpecificationDimension { + /* + * 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..1eee2bd742960 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationResourceServiceSpecification.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service specification. */ +@Fluent +public final class OperationResourceServiceSpecification { + /* + * 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..c68866680a98a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatusOperationsGetHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationStatusOperationsGetHeaders model. */ +@Fluent +public final class OperationStatusOperationsGetHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of OperationStatusOperationsGetHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public OperationStatusOperationsGetHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..c0eb8785e510c --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationStatusOperationsGetResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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..2116f89c662a3 --- /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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..c5c78ba5aa5a3 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationsListHeaders model. */ +@Fluent +public final class OperationsListHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of OperationsListHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public OperationsListHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..e6ee70b398291 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListNextHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationsListNextHeaders model. */ +@Fluent +public final class OperationsListNextHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of OperationsListNextHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public OperationsListNextHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..022055e53a9cf --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListNextResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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..e7f16e5939458 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/OperationsListResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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..1a08e2237e73b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PostRestoreRequest.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Post Restore Request. */ +@Fluent +public final class PostRestoreRequest { + /* + * 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..e5d9fb0ee2b11 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PreRestoreRequest.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Pre Restore request object. */ +@Fluent +public final class PreRestoreRequest { + /* + * 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..81ae60919c18e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpoint.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.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Private Endpoint resource. */ +@Immutable +public final class PrivateEndpoint { + /* + * 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..ca975790f5427 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnection.java @@ -0,0 +1,152 @@ +// 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.SystemData; +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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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..5be61c93e2b0d --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionListResult.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.resourcemanager.storagesync.fluent.models.PrivateEndpointConnectionInner; +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 { + /* + * 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..c5c237689d6c7 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionProvisioningState.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The current provisioning state. */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates 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); + } + + /** + * Gets known PrivateEndpointConnectionProvisioningState values. + * + * @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..09e3d26f07c89 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnections.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 along with {@link + * Response}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link + * Response}. + */ + 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 along with {@link + * Response}. + */ + 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/PrivateEndpointConnectionsListByStorageSyncServiceHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsListByStorageSyncServiceHeaders.java new file mode 100644 index 0000000000000..ffb64cc9c492b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsListByStorageSyncServiceHeaders.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PrivateEndpointConnectionsListByStorageSyncServiceHeaders model. */ +@Fluent +public final class PrivateEndpointConnectionsListByStorageSyncServiceHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of PrivateEndpointConnectionsListByStorageSyncServiceHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public PrivateEndpointConnectionsListByStorageSyncServiceHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..8f8b09ca831cb --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointConnectionsListByStorageSyncServiceResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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..3d7ee03353094 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateEndpointServiceConnectionStatus.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The private endpoint connection status. */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates 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); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @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..7d0d2d26d6610 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkResource.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.storagesync.fluent.models.PrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@Fluent +public final class PrivateLinkResource extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResource object itself. + */ + public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/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..074774881631c --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkResources.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.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 along with {@link + * Response}. + */ + 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..0632737bcd947 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/PrivateLinkServiceConnectionState.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.fasterxml.jackson.annotation.JsonProperty; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + /* + * 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/RecallActionParameters.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RecallActionParameters.java new file mode 100644 index 0000000000000..2197745969877 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RecallActionParameters.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.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used when calling recall action on server endpoint. */ +@Fluent +public final class RecallActionParameters { + /* + * 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..d5400bc5cfe64 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServer.java @@ -0,0 +1,387 @@ +// 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.SystemData; +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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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..7413cb90d78e4 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServerAgentVersionStatus.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of the registered server agent version status. */ +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); + } + + /** + * Gets known RegisteredServerAgentVersionStatus values. + * + * @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..813f891081cb0 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServerArray.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.resourcemanager.storagesync.fluent.models.RegisteredServerInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Array of RegisteredServer. */ +@Fluent +public final class RegisteredServerArray { + /* + * 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..dbd48c5dc0f6e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServerCreateParameters.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.storagesync.fluent.models.RegisteredServerCreateParametersProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used when creating a registered server. */ +@Fluent +public final class RegisteredServerCreateParameters extends ProxyResource { + /* + * The parameters used to create the registered server. + */ + @JsonProperty(value = "properties") + private RegisteredServerCreateParametersProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The parameters used to create the registered server. + * + * @return the innerProperties value. + */ + private RegisteredServerCreateParametersProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the serverCertificate property: Registered Server Certificate. + * + * @return the serverCertificate value. + */ + public String serverCertificate() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerCreateParametersProperties(); + } + this.innerProperties().withServerCertificate(serverCertificate); + return this; + } + + /** + * Get the agentVersion property: Registered Server Agent Version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerCreateParametersProperties(); + } + this.innerProperties().withAgentVersion(agentVersion); + return this; + } + + /** + * Get the serverOSVersion property: Registered Server OS Version. + * + * @return the serverOSVersion value. + */ + public String serverOSVersion() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerCreateParametersProperties(); + } + this.innerProperties().withServerOSVersion(serverOSVersion); + return this; + } + + /** + * Get the lastHeartBeat property: Registered Server last heart beat. + * + * @return the lastHeartBeat value. + */ + public String lastHeartBeat() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerCreateParametersProperties(); + } + this.innerProperties().withLastHeartBeat(lastHeartBeat); + return this; + } + + /** + * Get the serverRole property: Registered Server serverRole. + * + * @return the serverRole value. + */ + public String serverRole() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerCreateParametersProperties(); + } + this.innerProperties().withServerRole(serverRole); + return this; + } + + /** + * Get the clusterId property: Registered Server clusterId. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerCreateParametersProperties(); + } + this.innerProperties().withClusterId(clusterId); + return this; + } + + /** + * Get the clusterName property: Registered Server clusterName. + * + * @return the clusterName value. + */ + public String clusterName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerCreateParametersProperties(); + } + this.innerProperties().withClusterName(clusterName); + return this; + } + + /** + * Get the serverId property: Registered Server serverId. + * + * @return the serverId value. + */ + public String serverId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerCreateParametersProperties(); + } + this.innerProperties().withServerId(serverId); + return this; + } + + /** + * Get the friendlyName property: Friendly Name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Set the friendlyName property: Friendly Name. + * + * @param friendlyName the friendlyName value to set. + * @return the RegisteredServerCreateParameters object itself. + */ + public RegisteredServerCreateParameters withFriendlyName(String friendlyName) { + if (this.innerProperties() == null) { + this.innerProperties = new RegisteredServerCreateParametersProperties(); + } + this.innerProperties().withFriendlyName(friendlyName); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/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..4c36b8dc6f070 --- /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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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/RegisteredServersGetHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersGetHeaders.java new file mode 100644 index 0000000000000..8683348cd8935 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersGetHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The RegisteredServersGetHeaders model. */ +@Fluent +public final class RegisteredServersGetHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of RegisteredServersGetHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public RegisteredServersGetHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..bb92dbd84d600 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersGetResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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..f3cca20cdedce --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersListByStorageSyncServiceHeaders.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The RegisteredServersListByStorageSyncServiceHeaders model. */ +@Fluent +public final class RegisteredServersListByStorageSyncServiceHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of RegisteredServersListByStorageSyncServiceHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public RegisteredServersListByStorageSyncServiceHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..23f993f8ca411 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RegisteredServersListByStorageSyncServiceResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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/ResourceProviders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ResourceProviders.java new file mode 100644 index 0000000000000..777aa617a1295 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ResourceProviders.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.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * Get Operation status. + * + * @param locationName The desired region to obtain information from. + * @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. + */ + LocationOperationStatus locationOperationStatus(String locationName, String operationId); + + /** + * Get Operation status. + * + * @param locationName The desired region to obtain information from. + * @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 locationOperationStatusWithResponse( + String locationName, String operationId, Context context); +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ResourceProvidersLocationOperationStatusHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ResourceProvidersLocationOperationStatusHeaders.java new file mode 100644 index 0000000000000..6785e5c5dabf3 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ResourceProvidersLocationOperationStatusHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourceProvidersLocationOperationStatusHeaders model. */ +@Fluent +public final class ResourceProvidersLocationOperationStatusHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of ResourceProvidersLocationOperationStatusHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public ResourceProvidersLocationOperationStatusHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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 ResourceProvidersLocationOperationStatusHeaders object itself. + */ + public ResourceProvidersLocationOperationStatusHeaders 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 ResourceProvidersLocationOperationStatusHeaders object itself. + */ + public ResourceProvidersLocationOperationStatusHeaders 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/ResourceProvidersLocationOperationStatusResponse.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ResourceProvidersLocationOperationStatusResponse.java new file mode 100644 index 0000000000000..be72da996e04b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ResourceProvidersLocationOperationStatusResponse.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.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.LocationOperationStatusInner; + +/** Contains all response data for the locationOperationStatus operation. */ +public final class ResourceProvidersLocationOperationStatusResponse + extends ResponseBase { + /** + * Creates an instance of ResourceProvidersLocationOperationStatusResponse. + * + * @param request the request which resulted in this ResourceProvidersLocationOperationStatusResponse. + * @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 ResourceProvidersLocationOperationStatusResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + LocationOperationStatusInner value, + ResourceProvidersLocationOperationStatusHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public LocationOperationStatusInner getValue() { + return super.getValue(); + } +} 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..c402ef95b3861 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/RestoreFileSpec.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.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Restore file spec. */ +@Fluent +public final class RestoreFileSpec { + /* + * 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..80d44ca08e7ed --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpoint.java @@ -0,0 +1,497 @@ +// 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.SystemData; +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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..0f32a47dbb6ff --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointArray.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.resourcemanager.storagesync.fluent.models.ServerEndpointInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Array of ServerEndpoint. */ +@Fluent +public final class ServerEndpointArray { + /* + * 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..735f1c20a3074 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointBackgroundDataDownloadActivity.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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Background data download activity object. */ +@Immutable +public final class ServerEndpointBackgroundDataDownloadActivity { + /* + * 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..225461409039c --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointCloudTieringStatus.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.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Server endpoint cloud tiering status object. */ +@Immutable +public final class ServerEndpointCloudTieringStatus { + /* + * 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; + + /* + * Information regarding the low disk mode state + */ + @JsonProperty(value = "lowDiskMode", access = JsonProperty.Access.WRITE_ONLY) + private CloudTieringLowDiskMode lowDiskMode; + + /** + * 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; + } + + /** + * Get the lowDiskMode property: Information regarding the low disk mode state. + * + * @return the lowDiskMode value. + */ + public CloudTieringLowDiskMode lowDiskMode() { + return this.lowDiskMode; + } + + /** + * 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(); + } + if (lowDiskMode() != null) { + lowDiskMode().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..446accaec5252 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointCreateParameters.java @@ -0,0 +1,311 @@ +// 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.management.SystemData; +import com.azure.resourcemanager.storagesync.fluent.models.ServerEndpointCreateParametersProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used when creating a server endpoint. */ +@Fluent +public final class ServerEndpointCreateParameters extends ProxyResource { + /* + * The parameters used to create the server endpoint. + */ + @JsonProperty(value = "properties") + private ServerEndpointCreateParametersProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: The parameters used to create the server endpoint. + * + * @return the innerProperties value. + */ + private ServerEndpointCreateParametersProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the serverLocalPath property: Server Local path. + * + * @return the serverLocalPath value. + */ + public String serverLocalPath() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointCreateParametersProperties(); + } + this.innerProperties().withServerLocalPath(serverLocalPath); + return this; + } + + /** + * Get the cloudTiering property: Cloud Tiering. + * + * @return the cloudTiering value. + */ + public FeatureStatus cloudTiering() { + return this.innerProperties() == null ? null : this.innerProperties().cloudTiering(); + } + + /** + * Set the cloudTiering property: Cloud Tiering. + * + * @param cloudTiering the cloudTiering value to set. + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withCloudTiering(FeatureStatus cloudTiering) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointCreateParametersProperties(); + } + this.innerProperties().withCloudTiering(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointCreateParametersProperties(); + } + this.innerProperties().withVolumeFreeSpacePercent(volumeFreeSpacePercent); + return this; + } + + /** + * Get the tierFilesOlderThanDays property: Tier files older than days. + * + * @return the tierFilesOlderThanDays value. + */ + public Integer tierFilesOlderThanDays() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointCreateParametersProperties(); + } + this.innerProperties().withTierFilesOlderThanDays(tierFilesOlderThanDays); + return this; + } + + /** + * Get the friendlyName property: Friendly Name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.innerProperties() == null ? null : this.innerProperties().friendlyName(); + } + + /** + * Set the friendlyName property: Friendly Name. + * + * @param friendlyName the friendlyName value to set. + * @return the ServerEndpointCreateParameters object itself. + */ + public ServerEndpointCreateParameters withFriendlyName(String friendlyName) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointCreateParametersProperties(); + } + this.innerProperties().withFriendlyName(friendlyName); + return this; + } + + /** + * Get the serverResourceId property: Server Resource Id. + * + * @return the serverResourceId value. + */ + public String serverResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointCreateParametersProperties(); + } + this.innerProperties().withServerResourceId(serverResourceId); + return this; + } + + /** + * Get the offlineDataTransfer property: Offline data transfer. + * + * @return the offlineDataTransfer value. + */ + public FeatureStatus offlineDataTransfer() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointCreateParametersProperties(); + } + this.innerProperties().withOfflineDataTransfer(offlineDataTransfer); + return this; + } + + /** + * Get the offlineDataTransferShareName property: Offline data transfer share name. + * + * @return the offlineDataTransferShareName value. + */ + public String offlineDataTransferShareName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointCreateParametersProperties(); + } + this.innerProperties().withOfflineDataTransferShareName(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointCreateParametersProperties(); + } + this.innerProperties().withInitialDownloadPolicy(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointCreateParametersProperties(); + } + this.innerProperties().withLocalCacheMode(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointCreateParametersProperties(); + } + this.innerProperties().withInitialUploadPolicy(initialUploadPolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/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..52a53afa9dd65 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointFilesNotSyncingError.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Files not syncing error object. */ +@Immutable +public final class ServerEndpointFilesNotSyncingError { + /* + * 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..d7dedce766c25 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointHealthState.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; + +/** Type of the server endpoint health state. */ +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); + } + + /** + * Gets known ServerEndpointHealthState values. + * + * @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..b5454b487626f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointOfflineDataTransferState.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of the Health state. */ +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); + } + + /** + * Gets known ServerEndpointOfflineDataTransferState values. + * + * @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..d9c6610ec0818 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointRecallError.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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Server endpoint recall error object. */ +@Immutable +public final class ServerEndpointRecallError { + /* + * 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..533a27afbd8c1 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointRecallStatus.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Server endpoint recall status object. */ +@Immutable +public final class ServerEndpointRecallStatus { + /* + * 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..ba0fa8d87c42a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncActivityState.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; + +/** Type of the sync activity state. */ +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); + } + + /** + * Gets known ServerEndpointSyncActivityState values. + * + * @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..624181fcb2553 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncActivityStatus.java @@ -0,0 +1,141 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Sync Session status object. */ +@Immutable +public final class ServerEndpointSyncActivityStatus { + /* + * 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..c6a221089a0fe --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncMode.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Sync mode for the server endpoint. */ +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); + } + + /** + * Gets known ServerEndpointSyncMode values. + * + * @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..8b871c5850236 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncSessionStatus.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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Sync Session status object. */ +@Immutable +public final class ServerEndpointSyncSessionStatus { + /* + * 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..c0bc57cb2a421 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointSyncStatus.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Server Endpoint sync status. */ +@Immutable +public final class ServerEndpointSyncStatus { + /* + * 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..3152edcdc9b64 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointUpdateParameters.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.storagesync.fluent.models.ServerEndpointUpdateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters for updating an Server Endpoint. */ +@Fluent +public final class ServerEndpointUpdateParameters { + /* + * The properties of the server endpoint. + */ + @JsonProperty(value = "properties") + private ServerEndpointUpdateProperties innerProperties; + + /** + * Get the innerProperties property: The properties of the server endpoint. + * + * @return the innerProperties value. + */ + private ServerEndpointUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the cloudTiering property: Cloud Tiering. + * + * @return the cloudTiering value. + */ + public FeatureStatus cloudTiering() { + return this.innerProperties() == null ? null : this.innerProperties().cloudTiering(); + } + + /** + * Set the cloudTiering property: Cloud Tiering. + * + * @param cloudTiering the cloudTiering value to set. + * @return the ServerEndpointUpdateParameters object itself. + */ + public ServerEndpointUpdateParameters withCloudTiering(FeatureStatus cloudTiering) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointUpdateProperties(); + } + this.innerProperties().withCloudTiering(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointUpdateProperties(); + } + this.innerProperties().withVolumeFreeSpacePercent(volumeFreeSpacePercent); + return this; + } + + /** + * Get the tierFilesOlderThanDays property: Tier files older than days. + * + * @return the tierFilesOlderThanDays value. + */ + public Integer tierFilesOlderThanDays() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointUpdateProperties(); + } + this.innerProperties().withTierFilesOlderThanDays(tierFilesOlderThanDays); + return this; + } + + /** + * Get the offlineDataTransfer property: Offline data transfer. + * + * @return the offlineDataTransfer value. + */ + public FeatureStatus offlineDataTransfer() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointUpdateProperties(); + } + this.innerProperties().withOfflineDataTransfer(offlineDataTransfer); + return this; + } + + /** + * Get the offlineDataTransferShareName property: Offline data transfer share name. + * + * @return the offlineDataTransferShareName value. + */ + public String offlineDataTransferShareName() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointUpdateProperties(); + } + this.innerProperties().withOfflineDataTransferShareName(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ServerEndpointUpdateProperties(); + } + this.innerProperties().withLocalCacheMode(localCacheMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/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..7816ed92ff698 --- /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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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/ServerEndpointsGetHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsGetHeaders.java new file mode 100644 index 0000000000000..6efd3008aaea8 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsGetHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ServerEndpointsGetHeaders model. */ +@Fluent +public final class ServerEndpointsGetHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of ServerEndpointsGetHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public ServerEndpointsGetHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..8da29bc496613 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsGetResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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..33480e28bf268 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsListBySyncGroupHeaders.java @@ -0,0 +1,111 @@ +// 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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ServerEndpointsListBySyncGroupHeaders model. */ +@Fluent +public final class ServerEndpointsListBySyncGroupHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of ServerEndpointsListBySyncGroupHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public ServerEndpointsListBySyncGroupHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + this.location = rawHeaders.getValue("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..56c50d3e99e29 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/ServerEndpointsListBySyncGroupResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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/StorageSyncApiError.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncApiError.java new file mode 100644 index 0000000000000..008a0c71b1787 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncApiError.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.management.exception.ManagementError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Error type. */ +@Immutable +public final class StorageSyncApiError extends ManagementError { + /* + * 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..276e8662db6d9 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncApiErrorException.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.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); + } + + /** {@inheritDoc} */ + @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..ec0c4f45bb16b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncInnerErrorDetails.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Error Details object. */ +@Fluent +public final class StorageSyncInnerErrorDetails { + /* + * 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..51af62e1912c7 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncService.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * 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..3cfeae54351c8 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServiceArray.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.resourcemanager.storagesync.fluent.models.StorageSyncServiceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Array of StorageSyncServices. */ +@Fluent +public final class StorageSyncServiceArray { + /* + * 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..749ba5f3b41a7 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServiceCreateParameters.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storagesync.fluent.models.StorageSyncServiceCreateParametersProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters used when creating a storage sync service. */ +@Fluent +public final class StorageSyncServiceCreateParameters { + /* + * 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") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The parameters used to create the storage sync service. + */ + @JsonProperty(value = "properties") + private StorageSyncServiceCreateParametersProperties innerProperties; + + /** + * 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 innerProperties property: The parameters used to create the storage sync service. + * + * @return the innerProperties value. + */ + private StorageSyncServiceCreateParametersProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the incomingTrafficPolicy property: Incoming Traffic Policy. + * + * @return the incomingTrafficPolicy value. + */ + public IncomingTrafficPolicy incomingTrafficPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageSyncServiceCreateParametersProperties(); + } + this.innerProperties().withIncomingTrafficPolicy(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")); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageSyncServiceCreateParameters.class); +} 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..4149bf57b852c --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServiceUpdateParameters.java @@ -0,0 +1,91 @@ +// 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.resourcemanager.storagesync.fluent.models.StorageSyncServiceUpdateProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Parameters for updating an Storage sync service. */ +@Fluent +public final class StorageSyncServiceUpdateParameters { + /* + * The user-specified tags associated with the storage sync service. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The properties of the server endpoint. + */ + @JsonProperty(value = "properties") + private StorageSyncServiceUpdateProperties innerProperties; + + /** + * 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 innerProperties property: The properties of the server endpoint. + * + * @return the innerProperties value. + */ + private StorageSyncServiceUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the incomingTrafficPolicy property: Incoming Traffic Policy. + * + * @return the incomingTrafficPolicy value. + */ + public IncomingTrafficPolicy incomingTrafficPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageSyncServiceUpdateProperties(); + } + this.innerProperties().withIncomingTrafficPolicy(incomingTrafficPolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/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..c2f8181f1428c --- /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 along with {@link 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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/StorageSyncServicesGetByResourceGroupHeaders.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesGetByResourceGroupHeaders.java new file mode 100644 index 0000000000000..0f76125e2ff54 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesGetByResourceGroupHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The StorageSyncServicesGetByResourceGroupHeaders model. */ +@Fluent +public final class StorageSyncServicesGetByResourceGroupHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of StorageSyncServicesGetByResourceGroupHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public StorageSyncServicesGetByResourceGroupHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..f07a2c2fcac2b --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesGetByResourceGroupResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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..17d29ecefee33 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListByResourceGroupHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The StorageSyncServicesListByResourceGroupHeaders model. */ +@Fluent +public final class StorageSyncServicesListByResourceGroupHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of StorageSyncServicesListByResourceGroupHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public StorageSyncServicesListByResourceGroupHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..04002ef4054a8 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListByResourceGroupResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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..35944ac41ddd4 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The StorageSyncServicesListHeaders model. */ +@Fluent +public final class StorageSyncServicesListHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of StorageSyncServicesListHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public StorageSyncServicesListHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..a8b7ff3f0546f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/StorageSyncServicesListResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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/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..db78b4381da08 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupArray.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.resourcemanager.storagesync.fluent.models.SyncGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Array of SyncGroup. */ +@Fluent +public final class SyncGroupArray { + /* + * 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..4f47c5e617878 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupCreateParameters.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The parameters used when creating a sync group. */ +@Fluent +public final class SyncGroupCreateParameters extends ProxyResource { + /* + * The parameters used to create the sync group + */ + @JsonProperty(value = "properties") + private Object properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * 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..151946a6acb7a --- /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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..eff2b51279d89 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsCreateHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SyncGroupsCreateHeaders model. */ +@Fluent +public final class SyncGroupsCreateHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of SyncGroupsCreateHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public SyncGroupsCreateHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..c5fd067352095 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsCreateResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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..e9bf9b2ad6cd2 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsDeleteHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SyncGroupsDeleteHeaders model. */ +@Fluent +public final class SyncGroupsDeleteHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of SyncGroupsDeleteHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public SyncGroupsDeleteHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..50bd3d9518846 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsGetHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SyncGroupsGetHeaders model. */ +@Fluent +public final class SyncGroupsGetHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of SyncGroupsGetHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public SyncGroupsGetHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..89a62e823a78a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsGetResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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..110458ecbef97 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsListByStorageSyncServiceHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SyncGroupsListByStorageSyncServiceHeaders model. */ +@Fluent +public final class SyncGroupsListByStorageSyncServiceHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of SyncGroupsListByStorageSyncServiceHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public SyncGroupsListByStorageSyncServiceHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..02105148ab47a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/SyncGroupsListByStorageSyncServiceResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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..b124555855ebc --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/TriggerChangeDetectionParameters.java @@ -0,0 +1,106 @@ +// 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.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 { + /* + * 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..fbd7ef84acc44 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/TriggerRolloverRequest.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trigger Rollover Request. */ +@Fluent +public final class TriggerRolloverRequest { + /* + * 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..9deb1db5b5342 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/Workflow.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.management.SystemData; +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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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..bf55f25124ea6 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowArray.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.resourcemanager.storagesync.fluent.models.WorkflowInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Array of Workflow. */ +@Fluent +public final class WorkflowArray { + /* + * 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..61fa865e735f5 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowStatus.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.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of the Workflow Status. */ +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); + } + + /** + * Gets known WorkflowStatus values. + * + * @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..63f209ca12b56 --- /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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..f38a51cbb1186 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsAbortHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The WorkflowsAbortHeaders model. */ +@Fluent +public final class WorkflowsAbortHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of WorkflowsAbortHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public WorkflowsAbortHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..6ee2fd52d47e3 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsGetHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The WorkflowsGetHeaders model. */ +@Fluent +public final class WorkflowsGetHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of WorkflowsGetHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public WorkflowsGetHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..0958e4bb7a727 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsGetResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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..d4651da498e53 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsListByStorageSyncServiceHeaders.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.http.HttpHeaders; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The WorkflowsListByStorageSyncServiceHeaders model. */ +@Fluent +public final class WorkflowsListByStorageSyncServiceHeaders { + /* + * 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; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of WorkflowsListByStorageSyncServiceHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public WorkflowsListByStorageSyncServiceHeaders(HttpHeaders rawHeaders) { + this.xMsRequestId = rawHeaders.getValue("x-ms-request-id"); + this.xMsCorrelationRequestId = rawHeaders.getValue("x-ms-correlation-request-id"); + } + + /** + * 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..c7eba920843cb --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/main/java/com/azure/resourcemanager/storagesync/models/WorkflowsListByStorageSyncServiceResponse.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.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); + } + + /** + * Gets the deserialized response body. + * + * @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/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsAfsShareMetadataCertificatePublicKeysSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsAfsShareMetadataCertificatePublicKeysSamples.java new file mode 100644 index 0000000000000..8b8c2bb066850 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsAfsShareMetadataCertificatePublicKeysSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for CloudEndpoints AfsShareMetadataCertificatePublicKeys. */ +public final class CloudEndpointsAfsShareMetadataCertificatePublicKeysSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_AfsShareMetadataCertificatePublicKeys.json + */ + /** + * Sample code: CloudEndpoints_AfsShareMetadataCertificatePublicKeys. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsAfsShareMetadataCertificatePublicKeys( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .afsShareMetadataCertificatePublicKeysWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsCreateSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsCreateSamples.java new file mode 100644 index 0000000000000..ef201a6b2bf2a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsCreateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.generated; + +/** Samples for CloudEndpoints Create. */ +public final class CloudEndpointsCreateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_Create.json + */ + /** + * Sample code: CloudEndpoints_Create. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsCreate(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .define("SampleCloudEndpoint_1") + .withExistingSyncGroup("SampleResourceGroup_1", "SampleStorageSyncService_1", "SampleSyncGroup_1") + .withStorageAccountResourceId( + "/subscriptions/744f4d70-6d17-4921-8970-a765d14f763f/resourceGroups/tminienv59svc/providers/Microsoft.Storage/storageAccounts/tminienv59storage") + .withAzureFileShareName("cvcloud-afscv-0719-058-a94a1354-a1fd-4e9a-9a50-919fad8c4ba4") + .withStorageAccountTenantId("\"72f988bf-86f1-41af-91ab-2d7cd011db47\"") + .withFriendlyName("ankushbsubscriptionmgmtmab") + .create(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsDeleteSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsDeleteSamples.java new file mode 100644 index 0000000000000..e47a84dfb1811 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsDeleteSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.generated; + +import com.azure.core.util.Context; + +/** Samples for CloudEndpoints Delete. */ +public final class CloudEndpointsDeleteSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_Delete.json + */ + /** + * Sample code: CloudEndpoints_Delete. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsDelete(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .delete( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsGetSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsGetSamples.java new file mode 100644 index 0000000000000..dbd2777f3777a --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsGetSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.generated; + +import com.azure.core.util.Context; + +/** Samples for CloudEndpoints Get. */ +public final class CloudEndpointsGetSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_Get.json + */ + /** + * Sample code: CloudEndpoints_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .getWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsListBySyncGroupSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsListBySyncGroupSamples.java new file mode 100644 index 0000000000000..2f14db03d4105 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsListBySyncGroupSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for CloudEndpoints ListBySyncGroup. */ +public final class CloudEndpointsListBySyncGroupSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_ListBySyncGroup.json + */ + /** + * Sample code: CloudEndpoints_ListBySyncGroup. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsListBySyncGroup(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .listBySyncGroup("SampleResourceGroup_1", "SampleStorageSyncService_1", "SampleSyncGroup_1", Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPostBackupSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPostBackupSamples.java new file mode 100644 index 0000000000000..7736eca89ddef --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPostBackupSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.BackupRequest; + +/** Samples for CloudEndpoints PostBackup. */ +public final class CloudEndpointsPostBackupSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_PostBackup.json + */ + /** + * Sample code: CloudEndpoints_PostBackup. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsPostBackup(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .postBackup( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + new BackupRequest() + .withAzureFileShare("https://sampleserver.file.core.test-cint.azure-test.net/sampleFileShare"), + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPostRestoreSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPostRestoreSamples.java new file mode 100644 index 0000000000000..6715bfdf3edaf --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPostRestoreSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.PostRestoreRequest; +import com.azure.resourcemanager.storagesync.models.RestoreFileSpec; +import java.util.Arrays; + +/** Samples for CloudEndpoints PostRestore. */ +public final class CloudEndpointsPostRestoreSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_PostRestore.json + */ + /** + * Sample code: CloudEndpoints_PostRestore. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsPostRestore(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .postRestore( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + new PostRestoreRequest() + .withAzureFileShareUri( + "https://hfsazbackupdevintncus2.file.core.test-cint.azure-test.net/sampleFileShare") + .withStatus("Succeeded") + .withSourceAzureFileShareUri( + "https://hfsazbackupdevintncus2.file.core.test-cint.azure-test.net/sampleFileShare") + .withRestoreFileSpec( + Arrays + .asList( + new RestoreFileSpec().withPath("text1.txt").withIsdir(false), + new RestoreFileSpec().withPath("MyDir").withIsdir(true), + new RestoreFileSpec().withPath("MyDir/SubDir").withIsdir(false), + new RestoreFileSpec().withPath("MyDir/SubDir/File1.pdf").withIsdir(false))), + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPreBackupSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPreBackupSamples.java new file mode 100644 index 0000000000000..f6b5d397a03f8 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPreBackupSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.BackupRequest; + +/** Samples for CloudEndpoints PreBackup. */ +public final class CloudEndpointsPreBackupSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_PreBackup.json + */ + /** + * Sample code: CloudEndpoints_PreBackup. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsPreBackup(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .preBackup( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + new BackupRequest() + .withAzureFileShare("https://sampleserver.file.core.test-cint.azure-test.net/sampleFileShare"), + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPreRestoreSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPreRestoreSamples.java new file mode 100644 index 0000000000000..1b20c901cdde4 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsPreRestoreSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.PreRestoreRequest; +import com.azure.resourcemanager.storagesync.models.RestoreFileSpec; +import java.util.Arrays; + +/** Samples for CloudEndpoints PreRestore. */ +public final class CloudEndpointsPreRestoreSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_PreRestore.json + */ + /** + * Sample code: CloudEndpoints_PreRestore. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsPreRestore(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .preRestore( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + new PreRestoreRequest() + .withAzureFileShareUri( + "https://hfsazbackupdevintncus2.file.core.test-cint.azure-test.net/sampleFileShare") + .withRestoreFileSpec( + Arrays + .asList( + new RestoreFileSpec().withPath("text1.txt").withIsdir(false), + new RestoreFileSpec().withPath("MyDir").withIsdir(true), + new RestoreFileSpec().withPath("MyDir/SubDir").withIsdir(false), + new RestoreFileSpec().withPath("MyDir/SubDir/File1.pdf").withIsdir(false))), + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsRestoreheartbeatSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsRestoreheartbeatSamples.java new file mode 100644 index 0000000000000..a852fee1b7edb --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsRestoreheartbeatSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for CloudEndpoints Restoreheartbeat. */ +public final class CloudEndpointsRestoreheartbeatSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_RestoreHeatbeat.json + */ + /** + * Sample code: CloudEndpoints_restoreheartbeat. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsRestoreheartbeat( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .restoreheartbeatWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsTriggerChangeDetectionSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsTriggerChangeDetectionSamples.java new file mode 100644 index 0000000000000..da25816e3a86f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/CloudEndpointsTriggerChangeDetectionSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.ChangeDetectionMode; +import com.azure.resourcemanager.storagesync.models.TriggerChangeDetectionParameters; + +/** Samples for CloudEndpoints TriggerChangeDetection. */ +public final class CloudEndpointsTriggerChangeDetectionSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/CloudEndpoints_TriggerChangeDetection.json + */ + /** + * Sample code: CloudEndpoints_TriggerChangeDetection. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void cloudEndpointsTriggerChangeDetection( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .cloudEndpoints() + .triggerChangeDetection( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleCloudEndpoint_1", + new TriggerChangeDetectionParameters() + .withDirectoryPath("NewDirectory") + .withChangeDetectionMode(ChangeDetectionMode.RECURSIVE), + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/OperationStatusOperationGetSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/OperationStatusOperationGetSamples.java new file mode 100644 index 0000000000000..b2423071f9e8c --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/OperationStatusOperationGetSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.generated; + +import com.azure.core.util.Context; + +/** Samples for OperationStatusOperation Get. */ +public final class OperationStatusOperationGetSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/OperationStatus_Get.json + */ + /** + * Sample code: Workflows_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void workflowsGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .operationStatusOperations() + .getWithResponse( + "SampleResourceGroup_1", + "westus", + "828219ea-083e-48b5-89ea-8fd9991b2e75", + "14b50e24-f68d-4b29-a882-38be9dfb8bd1", + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/OperationsListSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..d8a218f930821 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void operationsList(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsCreateSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsCreateSamples.java new file mode 100644 index 0000000000000..ce28802b85015 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsCreateSamples.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.generated; + +import com.azure.resourcemanager.storagesync.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.storagesync.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Create. */ +public final class PrivateEndpointConnectionsCreateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/PrivateEndpointConnections_Create.json + */ + /** + * Sample code: PrivateEndpointConnections_Create. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void privateEndpointConnectionsCreate( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .privateEndpointConnections() + .define("{privateEndpointConnectionName}") + .withExistingStorageSyncService("res7687", "sss2527") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..70411a910db23 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/PrivateEndpointConnections_Delete.json + */ + /** + * Sample code: PrivateEndpointConnections_Delete. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void privateEndpointConnectionsDelete( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .privateEndpointConnections() + .delete("res6977", "sss2527", "{privateEndpointConnectionName}", Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..a5a7ee9f528d0 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsGetSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/PrivateEndpointConnections_Get.json + */ + /** + * Sample code: PrivateEndpointConnections_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void privateEndpointConnectionsGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("res6977", "sss2527", "{privateEndpointConnectionName}", Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsListByStorageSyncServiceSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsListByStorageSyncServiceSamples.java new file mode 100644 index 0000000000000..02f0aed1ca8f7 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateEndpointConnectionsListByStorageSyncServiceSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections ListByStorageSyncService. */ +public final class PrivateEndpointConnectionsListByStorageSyncServiceSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/PrivateEndpointConnections_ListByStorageSyncService.json + */ + /** + * Sample code: PrivateEndpointConnections_ListByStorageSyncService. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void privateEndpointConnectionsListByStorageSyncService( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager.privateEndpointConnections().listByStorageSyncService("res6977", "sss2527", Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateLinkResourcesListByStorageSyncServiceSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateLinkResourcesListByStorageSyncServiceSamples.java new file mode 100644 index 0000000000000..3af3753842835 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/PrivateLinkResourcesListByStorageSyncServiceSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources ListByStorageSyncService. */ +public final class PrivateLinkResourcesListByStorageSyncServiceSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/PrivateLinkResources_List.json + */ + /** + * Sample code: PrivateLinkResources_List. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void privateLinkResourcesList(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager.privateLinkResources().listByStorageSyncServiceWithResponse("res6977", "sss2527", Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersCreateSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersCreateSamples.java new file mode 100644 index 0000000000000..92d7714563552 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersCreateSamples.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.generated; + +/** Samples for RegisteredServers Create. */ +public final class RegisteredServersCreateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/RegisteredServers_Create.json + */ + /** + * Sample code: RegisteredServers_Create. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void registeredServersCreate(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .registeredServers() + .define("080d4133-bdb5-40a0-96a0-71a6057bfe9a") + .withExistingStorageSyncService("SampleResourceGroup_1", "SampleStorageSyncService_1") + .withServerCertificate( + "MIIDFjCCAf6gAwIBAgIQQS+DS8uhc4VNzUkTw7wbRjANBgkqhkiG9w0BAQ0FADAzMTEwLwYDVQQDEyhhbmt1c2hiLXByb2QzLnJlZG1vbmQuY29ycC5taWNyb3NvZnQuY29tMB4XDTE3MDgwMzE3MDQyNFoXDTE4MDgwNDE3MDQyNFowMzExMC8GA1UEAxMoYW5rdXNoYi1wcm9kMy5yZWRtb25kLmNvcnAubWljcm9zb2Z0LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALDRvV4gmsIy6jGDPiHsXmvgVP749NNP7DopdlbHaNhjFmYINHl0uWylyaZmgJrROt2mnxN/zEyJtGnqYHlzUr4xvGq/qV5pqgdB9tag/sw9i22gfe9PRZ0FmSOZnXMbLYgLiDFqLtut5gHcOuWMj03YnkfoBEKlFBxWbagvW2yxz/Sxi9OVSJOKCaXra0RpcIHrO/KFl6ho2eE1/7Ykmfa8hZvSdoPd5gHdLiQcMB/pxq+mWp1fI6c8vFZoDu7Atn+NXTzYPKUxKzaisF12TsaKpohUsJpbB3Wocb0F5frn614D2pg14ERB5otjAMWw1m65csQWPI6dP8KIYe0+QPkCAwEAAaMmMCQwIgYDVR0lAQH/BBgwFgYIKwYBBQUHAwIGCisGAQQBgjcKAwwwDQYJKoZIhvcNAQENBQADggEBAA4RhVIBkw34M1RwakJgHvtjsOFxF1tVQA941NtLokx1l2Z8+GFQkcG4xpZSt+UN6wLerdCbnNhtkCErWUDeaT0jxk4g71Ofex7iM04crT4iHJr8mi96/XnhnkTUs+GDk12VgdeeNEczMZz+8Mxw9dJ5NCnYgTwO0SzGlclRsDvjzkLo8rh2ZG6n/jKrEyNXXo+hOqhupij0QbRP2Tvexdfw201kgN1jdZify8XzJ8Oi0bTS0KpJf2pNPOlooK2bjMUei9ANtEdXwwfVZGWvVh6tJjdv6k14wWWJ1L7zhA1IIVb1J+sQUzJji5iX0DrezjTz1Fg+gAzITaA/WsuujlM=") + .withAgentVersion("1.0.277.0") + .withServerOSVersion("10.0.14393.0") + .withServerRole("Standalone") + .withServerId("080d4133-bdb5-40a0-96a0-71a6057bfe9a") + .withFriendlyName("afscv-2304-139") + .create(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersDeleteSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersDeleteSamples.java new file mode 100644 index 0000000000000..01b2460eecc66 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersDeleteSamples.java @@ -0,0 +1,28 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for RegisteredServers Delete. */ +public final class RegisteredServersDeleteSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/RegisteredServers_Delete.json + */ + /** + * Sample code: RegisteredServers_Delete. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void registeredServersDelete(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .registeredServers() + .delete( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "41166691-ab03-43e9-ab3e-0330eda162ac", + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersGetSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersGetSamples.java new file mode 100644 index 0000000000000..1e2289c4b42a8 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersGetSamples.java @@ -0,0 +1,28 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for RegisteredServers Get. */ +public final class RegisteredServersGetSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/RegisteredServers_Get.json + */ + /** + * Sample code: RegisteredServers_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void registeredServersGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .registeredServers() + .getWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "080d4133-bdb5-40a0-96a0-71a6057bfe9a", + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersListByStorageSyncServiceSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersListByStorageSyncServiceSamples.java new file mode 100644 index 0000000000000..0fa5926dd79a8 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersListByStorageSyncServiceSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for RegisteredServers ListByStorageSyncService. */ +public final class RegisteredServersListByStorageSyncServiceSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/RegisteredServers_ListByStorageSyncService.json + */ + /** + * Sample code: RegisteredServers_ListByStorageSyncService. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void registeredServersListByStorageSyncService( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .registeredServers() + .listByStorageSyncService("SampleResourceGroup_1", "SampleStorageSyncService_1", Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersTriggerRolloverSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersTriggerRolloverSamples.java new file mode 100644 index 0000000000000..37321ce8309d9 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/RegisteredServersTriggerRolloverSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.TriggerRolloverRequest; + +/** Samples for RegisteredServers TriggerRollover. */ +public final class RegisteredServersTriggerRolloverSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/RegisteredServers_TriggerRollover.json + */ + /** + * Sample code: RegisteredServers_triggerRollover. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void registeredServersTriggerRollover( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .registeredServers() + .triggerRollover( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "d166ca76-dad2-49df-b409-12345642d730", + new TriggerRolloverRequest() + .withServerCertificate( + "\"MIIDFjCCAf6gAwIBAgIQQS+DS8uhc4VNzUkTw7wbRjANBgkqhkiG9w0BAQ0FADAzMTEwLwYDVQQDEyhhbmt1c2hiLXByb2QzLnJlZG1vbmQuY29ycC5taWNyb3NvZnQuY29tMB4XDTE3MDgwMzE3MDQyNFoXDTE4MDgwNDE3MDQyNFowMzExMC8GA1UEAxMoYW5rdXNoYi1wcm9kMy5yZWRtb25kLmNvcnAubWljcm9zb2Z0LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALDRvV4gmsIy6jGDPiHsXmvgVP749NNP7DopdlbHaNhjFmYINHl0uWylyaZmgJrROt2mnxN/zEyJtGnqYHlzUr4xvGq/qV5pqgdB9tag/sw9i22gfe9PRZ0FmSOZnXMbLYgLiDFqLtut5gHcOuWMj03YnkfoBEKlFBxWbagvW2yxz/Sxi9OVSJOKCaXra0RpcIHrO/KFl6ho2eE1/7Ykmfa8hZvSdoPd5gHdLiQcMB/pxq+mWp1fI6c8vFZoDu7Atn+NXTzYPKUxKzaisF12TsaKpohUsJpbB3Wocb0F5frn614D2pg14ERB5otjAMWw1m65csQWPI6dP8KIYe0+QPkCAwEAAaMmMCQwIgYDVR0lAQH/BBgwFgYIKwYBBQUHAwIGCisGAQQBgjcKAwwwDQYJKoZIhvcNAQENBQADggEBAA4RhVIBkw34M1RwakJgHvtjsOFxF1tVQA941NtLokx1l2Z8+GFQkcG4xpZSt+UN6wLerdCbnNhtkCErWUDeaT0jxk4g71Ofex7iM04crT4iHJr8mi96/XnhnkTUs+GDk12VgdeeNEczMZz+8Mxw9dJ5NCnYgTwO0SzGlclRsDvjzkLo8rh2ZG6n/jKrEyNXXo+hOqhupij0QbRP2Tvexdfw201kgN1jdZify8XzJ8Oi0bTS0KpJf2pNPOlooK2bjMUei9ANtEdXwwfVZGWvVh6tJjdv6k14wWWJ1L7zhA1IIVb1J+sQUzJji5iX0DrezjTz1Fg+gAzITaA/WsuujlM=\""), + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ResourceProviderLocationOperationStatusSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ResourceProviderLocationOperationStatusSamples.java new file mode 100644 index 0000000000000..66550fb8e0189 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ResourceProviderLocationOperationStatusSamples.java @@ -0,0 +1,27 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ResourceProvider LocationOperationStatus. */ +public final class ResourceProviderLocationOperationStatusSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/LocationOperationStatus_Get.json + */ + /** + * Sample code: Workflows_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void workflowsGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .resourceProviders() + .locationOperationStatusWithResponse( + "westus", + "eyJwYXJ0aXRpb25JZCI6ImE1ZDNiMDU4LTYwN2MtNDI0Ny05Y2FmLWJlZmU4NGQ0ZDU0NyIsIndvcmtmbG93SWQiOiJjYzg1MTY2YS0xMjI2LTQ4MGYtYWM5ZC1jMmRhNTVmY2M2ODYiLCJ3b3JrZmxvd09wZXJhdGlvbklkIjoiOTdmODU5ZTAtOGY1MC00ZTg4LWJkZDEtNWZlYzgwYTVlYzM0tui=", + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsCreateSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsCreateSamples.java new file mode 100644 index 0000000000000..51d124bc3dbea --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsCreateSamples.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.generated; + +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; + +/** Samples for ServerEndpoints Create. */ +public final class ServerEndpointsCreateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/ServerEndpoints_Create.json + */ + /** + * Sample code: ServerEndpoints_Create. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void serverEndpointsCreate(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .serverEndpoints() + .define("SampleServerEndpoint_1") + .withExistingSyncGroup("SampleResourceGroup_1", "SampleStorageSyncService_1", "SampleSyncGroup_1") + .withServerLocalPath("D:\\SampleServerEndpoint_1") + .withCloudTiering(FeatureStatus.OFF) + .withVolumeFreeSpacePercent(100) + .withTierFilesOlderThanDays(0) + .withServerResourceId( + "/subscriptions/52b8da2f-61e0-4a1f-8dde-336911f367fb/resourceGroups/SampleResourceGroup_1/providers/Microsoft.StorageSync/storageSyncServices/SampleStorageSyncService_1/registeredServers/080d4133-bdb5-40a0-96a0-71a6057bfe9a") + .withOfflineDataTransfer(FeatureStatus.ON) + .withOfflineDataTransferShareName("myfileshare") + .withInitialDownloadPolicy(InitialDownloadPolicy.NAMESPACE_THEN_MODIFIED_FILES) + .withLocalCacheMode(LocalCacheMode.UPDATE_LOCALLY_CACHED_FILES) + .withInitialUploadPolicy(InitialUploadPolicy.SERVER_AUTHORITATIVE) + .create(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsDeleteSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsDeleteSamples.java new file mode 100644 index 0000000000000..93169d921bdab --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsDeleteSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.generated; + +import com.azure.core.util.Context; + +/** Samples for ServerEndpoints Delete. */ +public final class ServerEndpointsDeleteSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/ServerEndpoints_Delete.json + */ + /** + * Sample code: ServerEndpoints_Delete. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void serverEndpointsDelete(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .serverEndpoints() + .delete( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleServerEndpoint_1", + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsGetSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsGetSamples.java new file mode 100644 index 0000000000000..e798c1b40cdd9 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsGetSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.generated; + +import com.azure.core.util.Context; + +/** Samples for ServerEndpoints Get. */ +public final class ServerEndpointsGetSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/ServerEndpoints_Get.json + */ + /** + * Sample code: ServerEndpoints_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void serverEndpointsGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .serverEndpoints() + .getWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleServerEndpoint_1", + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsListBySyncGroupSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsListBySyncGroupSamples.java new file mode 100644 index 0000000000000..7b0c6a92793cd --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsListBySyncGroupSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for ServerEndpoints ListBySyncGroup. */ +public final class ServerEndpointsListBySyncGroupSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/ServerEndpoints_ListBySyncGroup.json + */ + /** + * Sample code: ServerEndpoints_ListBySyncGroup. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void serverEndpointsListBySyncGroup( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .serverEndpoints() + .listBySyncGroup("SampleResourceGroup_1", "SampleStorageSyncService_1", "SampleSyncGroup_1", Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsRecallActionSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsRecallActionSamples.java new file mode 100644 index 0000000000000..5dc9ff0a79d7e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsRecallActionSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.RecallActionParameters; + +/** Samples for ServerEndpoints RecallAction. */ +public final class ServerEndpointsRecallActionSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/ServerEndpoints_Recall.json + */ + /** + * Sample code: ServerEndpoints_recallAction. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void serverEndpointsRecallAction(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .serverEndpoints() + .recallAction( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleServerEndpoint_1", + new RecallActionParameters().withPattern("").withRecallPath(""), + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsUpdateSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsUpdateSamples.java new file mode 100644 index 0000000000000..2e16bb53dea4f --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/ServerEndpointsUpdateSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.FeatureStatus; +import com.azure.resourcemanager.storagesync.models.LocalCacheMode; +import com.azure.resourcemanager.storagesync.models.ServerEndpoint; + +/** Samples for ServerEndpoints Update. */ +public final class ServerEndpointsUpdateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/ServerEndpoints_Update.json + */ + /** + * Sample code: ServerEndpoints_Update. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void serverEndpointsUpdate(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + ServerEndpoint resource = + manager + .serverEndpoints() + .getWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "SampleSyncGroup_1", + "SampleServerEndpoint_1", + Context.NONE) + .getValue(); + resource + .update() + .withCloudTiering(FeatureStatus.OFF) + .withVolumeFreeSpacePercent(100) + .withTierFilesOlderThanDays(0) + .withOfflineDataTransfer(FeatureStatus.OFF) + .withLocalCacheMode(LocalCacheMode.UPDATE_LOCALLY_CACHED_FILES) + .apply(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesCheckNameAvailabilitySamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..f0900f69fe2a6 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesCheckNameAvailabilitySamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.CheckNameAvailabilityParameters; + +/** Samples for StorageSyncServices CheckNameAvailability. */ +public final class StorageSyncServicesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServiceCheckNameAvailability_Available.json + */ + /** + * Sample code: StorageSyncServiceCheckNameAvailability_Available. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServiceCheckNameAvailabilityAvailable( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .storageSyncServices() + .checkNameAvailabilityWithResponse( + "westus", new CheckNameAvailabilityParameters().withName("newstoragesyncservicename"), Context.NONE); + } + + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServiceCheckNameAvailability_AlreadyExists.json + */ + /** + * Sample code: StorageSyncServiceCheckNameAvailability_AlreadyExists. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServiceCheckNameAvailabilityAlreadyExists( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .storageSyncServices() + .checkNameAvailabilityWithResponse( + "westus", new CheckNameAvailabilityParameters().withName("newstoragesyncservicename"), Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesCreateSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesCreateSamples.java new file mode 100644 index 0000000000000..50d45a47944a6 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesCreateSamples.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.generated; + +import com.azure.resourcemanager.storagesync.models.IncomingTrafficPolicy; +import java.util.HashMap; +import java.util.Map; + +/** Samples for StorageSyncServices Create. */ +public final class StorageSyncServicesCreateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServices_Create.json + */ + /** + * Sample code: StorageSyncServices_Create. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServicesCreate(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .storageSyncServices() + .define("SampleStorageSyncService_1") + .withRegion("WestUS") + .withExistingResourceGroup("SampleResourceGroup_1") + .withTags(mapOf()) + .withIncomingTrafficPolicy(IncomingTrafficPolicy.ALLOW_ALL_TRAFFIC) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesDeleteSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesDeleteSamples.java new file mode 100644 index 0000000000000..bef20059f1328 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesDeleteSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for StorageSyncServices Delete. */ +public final class StorageSyncServicesDeleteSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServices_Delete.json + */ + /** + * Sample code: StorageSyncServices_Delete. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServicesDelete(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager.storageSyncServices().delete("SampleResourceGroup_1", "SampleStorageSyncService_1", Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesGetByResourceGroupSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..c887a32696f06 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesGetByResourceGroupSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for StorageSyncServices GetByResourceGroup. */ +public final class StorageSyncServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServices_Get.json + */ + /** + * Sample code: StorageSyncServices_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServicesGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .storageSyncServices() + .getByResourceGroupWithResponse("SampleResourceGroup_1", "SampleStorageSyncService_1", Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesListByResourceGroupSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..f5110db037efc --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.generated; + +import com.azure.core.util.Context; + +/** Samples for StorageSyncServices ListByResourceGroup. */ +public final class StorageSyncServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServices_ListByResourceGroup.json + */ + /** + * Sample code: StorageSyncServices_ListByResourceGroup. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServicesListByResourceGroup( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager.storageSyncServices().listByResourceGroup("SampleResourceGroup_1", Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesListSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesListSamples.java new file mode 100644 index 0000000000000..34742ecd01ffd --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.storagesync.generated; + +import com.azure.core.util.Context; + +/** Samples for StorageSyncServices List. */ +public final class StorageSyncServicesListSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServices_ListBySubscription.json + */ + /** + * Sample code: StorageSyncServices_ListBySubscription. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServicesListBySubscription( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager.storageSyncServices().list(Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesUpdateSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesUpdateSamples.java new file mode 100644 index 0000000000000..65e9202da3401 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/StorageSyncServicesUpdateSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.storagesync.models.IncomingTrafficPolicy; +import com.azure.resourcemanager.storagesync.models.StorageSyncService; +import java.util.HashMap; +import java.util.Map; + +/** Samples for StorageSyncServices Update. */ +public final class StorageSyncServicesUpdateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/StorageSyncServices_Update.json + */ + /** + * Sample code: StorageSyncServices_Update. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void storageSyncServicesUpdate(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + StorageSyncService resource = + manager + .storageSyncServices() + .getByResourceGroupWithResponse("SampleResourceGroup_1", "SampleStorageSyncService_1", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("Dept", "IT", "Environment", "Test")) + .withIncomingTrafficPolicy(IncomingTrafficPolicy.ALLOW_ALL_TRAFFIC) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsCreateSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsCreateSamples.java new file mode 100644 index 0000000000000..d0367b5d0694c --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsCreateSamples.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.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** Samples for SyncGroups Create. */ +public final class SyncGroupsCreateSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/SyncGroups_Create.json + */ + /** + * Sample code: SyncGroups_Create. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void syncGroupsCreate(com.azure.resourcemanager.storagesync.StoragesyncManager manager) + throws IOException { + manager + .syncGroups() + .define("SampleSyncGroup_1") + .withExistingStorageSyncService("SampleResourceGroup_1", "SampleStorageSyncService_1") + .withProperties( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .create(); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsDeleteSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsDeleteSamples.java new file mode 100644 index 0000000000000..2c1a036003e0c --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsDeleteSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for SyncGroups Delete. */ +public final class SyncGroupsDeleteSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/SyncGroups_Delete.json + */ + /** + * Sample code: SyncGroups_Delete. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void syncGroupsDelete(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .syncGroups() + .deleteWithResponse( + "SampleResourceGroup_1", "SampleStorageSyncService_1", "SampleSyncGroup_1", Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsGetSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsGetSamples.java new file mode 100644 index 0000000000000..f78286ed6aa95 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsGetSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for SyncGroups Get. */ +public final class SyncGroupsGetSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/SyncGroups_Get.json + */ + /** + * Sample code: SyncGroups_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void syncGroupsGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .syncGroups() + .getWithResponse("SampleResourceGroup_1", "SampleStorageSyncService_1", "SampleSyncGroup_1", Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsListByStorageSyncServiceSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsListByStorageSyncServiceSamples.java new file mode 100644 index 0000000000000..ae29f2418c70e --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/SyncGroupsListByStorageSyncServiceSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for SyncGroups ListByStorageSyncService. */ +public final class SyncGroupsListByStorageSyncServiceSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/SyncGroups_ListByStorageSyncService.json + */ + /** + * Sample code: SyncGroups_ListByStorageSyncService. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void syncGroupsListByStorageSyncService( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .syncGroups() + .listByStorageSyncService("SampleResourceGroup_1", "SampleStorageSyncService_1", Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/WorkflowsAbortSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/WorkflowsAbortSamples.java new file mode 100644 index 0000000000000..e1a067bd3a1a6 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/WorkflowsAbortSamples.java @@ -0,0 +1,28 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Workflows Abort. */ +public final class WorkflowsAbortSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/Workflows_Abort.json + */ + /** + * Sample code: Workflows_Abort. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void workflowsAbort(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .workflows() + .abortWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "7ffd50b3-5574-478d-9ff2-9371bc42ce68", + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/WorkflowsGetSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/WorkflowsGetSamples.java new file mode 100644 index 0000000000000..12b53ac128a62 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/WorkflowsGetSamples.java @@ -0,0 +1,28 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Workflows Get. */ +public final class WorkflowsGetSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/Workflows_Get.json + */ + /** + * Sample code: Workflows_Get. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void workflowsGet(com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .workflows() + .getWithResponse( + "SampleResourceGroup_1", + "SampleStorageSyncService_1", + "828219ea-083e-48b5-89ea-8fd9991b2e75", + Context.NONE); + } +} diff --git a/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/WorkflowsListByStorageSyncServiceSamples.java b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/WorkflowsListByStorageSyncServiceSamples.java new file mode 100644 index 0000000000000..18d39de769794 --- /dev/null +++ b/sdk/storagesync/azure-resourcemanager-storagesync/src/samples/java/com/azure/resourcemanager/storagesync/generated/WorkflowsListByStorageSyncServiceSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for Workflows ListByStorageSyncService. */ +public final class WorkflowsListByStorageSyncServiceSamples { + /* + * x-ms-original-file: specification/storagesync/resource-manager/Microsoft.StorageSync/stable/2022-06-01/examples/Workflows_ListByStorageSyncService.json + */ + /** + * Sample code: Workflows_ListByStorageSyncService. + * + * @param manager Entry point to StoragesyncManager. + */ + public static void workflowsListByStorageSyncService( + com.azure.resourcemanager.storagesync.StoragesyncManager manager) { + manager + .workflows() + .listByStorageSyncService("SampleResourceGroup_1", "SampleStorageSyncService_1", Context.NONE); + } +} diff --git a/sdk/storagesync/ci.yml b/sdk/storagesync/ci.yml new file mode 100644 index 0000000000000..8710449ffbb04 --- /dev/null +++ b/sdk/storagesync/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/storagesync/ci.yml + - sdk/storagesync/azure-resourcemanager-storagesync/ + exclude: + - sdk/storagesync/pom.xml + - sdk/storagesync/azure-resourcemanager-storagesync/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagesync/ci.yml + - sdk/storagesync/azure-resourcemanager-storagesync/ + exclude: + - sdk/storagesync/pom.xml + - sdk/storagesync/azure-resourcemanager-storagesync/pom.xml + +parameters: + - name: release_azureresourcemanagerstoragesync + displayName: azure-resourcemanager-storagesync + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: storagesync + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-storagesync + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerstoragesync + releaseInBatch: ${{ parameters.release_azureresourcemanagerstoragesync }} diff --git a/sdk/storagesync/pom.xml b/sdk/storagesync/pom.xml new file mode 100644 index 0000000000000..a533ee935954d --- /dev/null +++ b/sdk/storagesync/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-storagesync-service + pom + 1.0.0 + + + azure-resourcemanager-storagesync + +