From 3c71f1807620439e951f9bb01fdf80ed0e30266a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 13 May 2025 19:30:49 +0000 Subject: [PATCH] CodeGen from PR 34640 in Azure/azure-rest-api-specs Merge 7f7ae8ab02f8654fbeb9618b34fa696c326cdfe9 into 7fc6689d84858b1c71b786526b04c014c4589968 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 8 + .../README.md | 102 + .../SAMPLE.md | 859 ++++ .../pom.xml | 62 + .../AzuredatatransferManager.java | 346 ++ .../fluent/AzureDataTransfersClient.java | 69 + .../fluent/Azuredatatransferrp.java | 83 + .../fluent/ConnectionsClient.java | 356 ++ .../azuredatatransfer/fluent/FlowsClient.java | 871 ++++ .../fluent/OperationsClient.java | 40 + .../fluent/PipelinesClient.java | 515 +++ .../fluent/models/ConnectionInner.java | 224 + .../fluent/models/FlowInner.java | 255 ++ .../fluent/models/FlowPropertiesInner.java | 853 ++++ ...etDestinationEndpointPortsResultInner.java | 97 + .../GetDestinationEndpointsResultInner.java | 96 + .../GetStreamConnectionStringResultInner.java | 95 + .../ListFlowsByPipelineResultInner.java | 101 + .../fluent/models/OperationInner.java | 172 + .../fluent/models/PendingConnectionInner.java | 741 ++++ .../fluent/models/PendingFlowInner.java | 1050 +++++ .../fluent/models/PipelineInner.java | 224 + .../fluent/models/SchemasListResultInner.java | 99 + .../models/StreamSourceAddressesInner.java | 96 + .../models/ValidateSchemaResultInner.java | 122 + .../fluent/models/package-info.java | 9 + .../fluent/package-info.java | 9 + .../AzureDataTransfersClientImpl.java | 266 ++ .../AzureDataTransfersImpl.java | 79 + .../AzuredatatransferrpBuilder.java | 138 + .../AzuredatatransferrpImpl.java | 372 ++ .../implementation/ConnectionImpl.java | 222 + .../implementation/ConnectionsClientImpl.java | 2139 +++++++++ .../implementation/ConnectionsImpl.java | 193 + .../implementation/FlowImpl.java | 326 ++ .../implementation/FlowPropertiesImpl.java | 184 + .../implementation/FlowsClientImpl.java | 3882 +++++++++++++++++ .../implementation/FlowsImpl.java | 420 ++ ...GetDestinationEndpointPortsResultImpl.java | 39 + .../GetDestinationEndpointsResultImpl.java | 39 + .../GetStreamConnectionStringResultImpl.java | 32 + .../ListFlowsByPipelineResultImpl.java | 40 + .../implementation/OperationImpl.java | 51 + .../implementation/OperationsClientImpl.java | 284 ++ .../implementation/OperationsImpl.java | 45 + .../implementation/PendingConnectionImpl.java | 194 + .../implementation/PendingFlowImpl.java | 234 + .../implementation/PipelineImpl.java | 246 ++ .../implementation/PipelinesClientImpl.java | 2468 +++++++++++ .../implementation/PipelinesImpl.java | 254 ++ .../implementation/ResourceManagerUtils.java | 195 + .../implementation/SchemasListResultImpl.java | 40 + .../StreamSourceAddressesImpl.java | 39 + .../ValidateSchemaResultImpl.java | 37 + .../implementation/package-info.java | 9 + .../azuredatatransfer/models/Action.java | 195 + .../azuredatatransfer/models/ActionType.java | 46 + .../models/ApiFlowOptions.java | 264 ++ .../azuredatatransfer/models/ApiMode.java | 51 + .../models/AzureDataTransfers.java | 59 + .../azuredatatransfer/models/Connection.java | 350 ++ .../models/ConnectionIdList.java | 95 + .../models/ConnectionListResult.java | 134 + .../models/ConnectionProperties.java | 554 +++ .../models/ConnectionStatus.java | 61 + .../azuredatatransfer/models/Connections.java | 235 + .../models/ConnectionsPatch.java | 126 + .../azuredatatransfer/models/DataType.java | 51 + .../azuredatatransfer/models/Direction.java | 51 + .../azuredatatransfer/models/Flow.java | 564 +++ .../models/FlowBillingTier.java | 56 + .../models/FlowListResult.java | 134 + .../models/FlowProperties.java | 223 + .../azuredatatransfer/models/FlowStatus.java | 51 + .../azuredatatransfer/models/FlowType.java | 111 + .../azuredatatransfer/models/Flows.java | 490 +++ .../azuredatatransfer/models/FlowsPatch.java | 126 + .../models/ForceDisabledStatus.java | 51 + .../GetDestinationEndpointPortsResult.java | 28 + .../models/GetDestinationEndpointsResult.java | 28 + .../GetStreamConnectionStringResult.java | 27 + .../models/IdentityTranslation.java | 51 + .../models/InternalMetadataProperties.java | 150 + .../azuredatatransfer/models/LinkStatus.java | 51 + .../models/ListApprovedSchemasRequest.java | 121 + .../models/ListFlowsByPipelineConnection.java | 128 + .../models/ListFlowsByPipelineResult.java | 27 + .../models/ManagedServiceIdentity.java | 190 + .../models/ManagedServiceIdentityType.java | 62 + .../models/MessagingOptions.java | 93 + .../azuredatatransfer/models/Operation.java | 58 + .../models/OperationDisplay.java | 136 + .../models/OperationListResult.java | 104 + .../models/OperationStatusEnum.java | 51 + .../models/OperationStatusProperties.java | 113 + .../azuredatatransfer/models/Operations.java | 35 + .../azuredatatransfer/models/Origin.java | 57 + .../models/PendingConnection.java | 221 + .../models/PendingConnectionListResult.java | 136 + .../azuredatatransfer/models/PendingFlow.java | 290 ++ .../models/PendingFlowListResult.java | 134 + .../azuredatatransfer/models/Pipeline.java | 413 ++ .../models/PipelineConnection.java | 251 ++ .../models/PipelineConnectionProperties.java | 135 + .../models/PipelineListResult.java | 134 + .../models/PipelineProperties.java | 373 ++ .../models/PipelineStatus.java | 51 + .../azuredatatransfer/models/Pipelines.java | 293 ++ .../models/PipelinesPatch.java | 157 + .../models/PipelinesPatchProperties.java | 129 + .../azuredatatransfer/models/Plan.java | 224 + .../models/ProvisioningState.java | 61 + .../models/ResourceBody.java | 129 + .../azuredatatransfer/models/Schema.java | 289 ++ .../models/SchemaStatus.java | 51 + .../azuredatatransfer/models/SchemaType.java | 51 + .../models/SchemasListResult.java | 27 + .../models/SelectedResource.java | 185 + .../models/SetDestinationEndpointPorts.java | 95 + .../models/SetDestinationEndpoints.java | 95 + .../models/SetSourceAddresses.java | 95 + .../models/SetStreamPassphrase.java | 93 + .../models/StreamProtocol.java | 56 + .../models/StreamSourceAddresses.java | 27 + .../azuredatatransfer/models/Subscriber.java | 121 + .../azuredatatransfer/models/TargetType.java | 56 + .../models/UserAssignedIdentity.java | 100 + .../models/ValidateSchemaResult.java | 33 + .../models/ValidateSchemaStatus.java | 51 + .../models/package-info.java | 9 + .../azuredatatransfer/package-info.java | 9 + .../src/main/java/module-info.java | 15 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + ...sourcemanager-azuredatatransfer.properties | 1 + .../ConnectionsCreateOrUpdateSamples.java | 29 + .../generated/ConnectionsDeleteSamples.java | 25 + .../ConnectionsGetByResourceGroupSamples.java | 26 + .../generated/ConnectionsLinkSamples.java | 25 + ...ConnectionsListByResourceGroupSamples.java | 25 + .../ConnectionsListBySubscriptionSamples.java | 25 + .../generated/ConnectionsUpdateSamples.java | 30 + .../generated/FlowsCreateOrUpdateSamples.java | 29 + .../generated/FlowsDeleteSamples.java | 25 + .../generated/FlowsEnableSamples.java | 25 + .../FlowsGeneratePassphraseSamples.java | 25 + ...owsGetDestinationEndpointPortsSamples.java | 27 + .../FlowsGetDestinationEndpointsSamples.java | 27 + .../generated/FlowsGetSamples.java | 24 + .../FlowsGetSourceAddressesSamples.java | 26 + ...FlowsGetStreamConnectionStringSamples.java | 27 + .../generated/FlowsLinkSamples.java | 25 + .../FlowsListByConnectionSamples.java | 25 + ...owsSetDestinationEndpointPortsSamples.java | 27 + .../FlowsSetDestinationEndpointsSamples.java | 26 + .../generated/FlowsSetPassphraseSamples.java | 25 + .../FlowsSetSourceAddressesSamples.java | 26 + .../generated/FlowsUpdateSamples.java | 30 + .../generated/OperationsListSamples.java | 24 + .../PipelinesCreateOrUpdateSamples.java | 29 + .../generated/PipelinesDeleteSamples.java | 25 + .../PipelinesExecuteActionSamples.java | 25 + .../PipelinesGetByResourceGroupSamples.java | 25 + .../PipelinesListByResourceGroupSamples.java | 25 + .../PipelinesListBySubscriptionSamples.java | 25 + .../PipelinesRejectConnectionSamples.java | 25 + .../generated/PipelinesUpdateSamples.java | 30 + sdk/azuredatatransfer/ci.yml | 46 + sdk/azuredatatransfer/pom.xml | 15 + 171 files changed, 31101 insertions(+) create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/CHANGELOG.md create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/README.md create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/SAMPLE.md create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/pom.xml create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/AzuredatatransferManager.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/AzureDataTransfersClient.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/Azuredatatransferrp.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/ConnectionsClient.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/FlowsClient.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/OperationsClient.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/PipelinesClient.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/ConnectionInner.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/FlowInner.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/FlowPropertiesInner.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/GetDestinationEndpointPortsResultInner.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/GetDestinationEndpointsResultInner.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/GetStreamConnectionStringResultInner.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/ListFlowsByPipelineResultInner.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/OperationInner.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/PendingConnectionInner.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/PendingFlowInner.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/PipelineInner.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/SchemasListResultInner.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/StreamSourceAddressesInner.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/ValidateSchemaResultInner.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/package-info.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/package-info.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzureDataTransfersClientImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzureDataTransfersImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzuredatatransferrpBuilder.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzuredatatransferrpImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ConnectionImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ConnectionsClientImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ConnectionsImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowPropertiesImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowsClientImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowsImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/GetDestinationEndpointPortsResultImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/GetDestinationEndpointsResultImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/GetStreamConnectionStringResultImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ListFlowsByPipelineResultImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/OperationImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/OperationsClientImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/OperationsImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PendingConnectionImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PendingFlowImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PipelineImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PipelinesClientImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PipelinesImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ResourceManagerUtils.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/SchemasListResultImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/StreamSourceAddressesImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ValidateSchemaResultImpl.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/package-info.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Action.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ActionType.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ApiFlowOptions.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ApiMode.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/AzureDataTransfers.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Connection.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionIdList.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionListResult.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionProperties.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionStatus.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Connections.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionsPatch.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/DataType.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Direction.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Flow.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowBillingTier.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowListResult.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowProperties.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowStatus.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowType.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Flows.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowsPatch.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ForceDisabledStatus.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/GetDestinationEndpointPortsResult.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/GetDestinationEndpointsResult.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/GetStreamConnectionStringResult.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/IdentityTranslation.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/InternalMetadataProperties.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/LinkStatus.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ListApprovedSchemasRequest.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ListFlowsByPipelineConnection.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ListFlowsByPipelineResult.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ManagedServiceIdentity.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ManagedServiceIdentityType.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/MessagingOptions.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Operation.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationDisplay.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationListResult.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationStatusEnum.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationStatusProperties.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Operations.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Origin.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingConnection.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingConnectionListResult.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingFlow.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingFlowListResult.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Pipeline.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineConnection.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineConnectionProperties.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineListResult.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineProperties.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineStatus.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Pipelines.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelinesPatch.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelinesPatchProperties.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Plan.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ProvisioningState.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ResourceBody.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Schema.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SchemaStatus.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SchemaType.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SchemasListResult.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SelectedResource.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetDestinationEndpointPorts.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetDestinationEndpoints.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetSourceAddresses.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetStreamPassphrase.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/StreamProtocol.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/StreamSourceAddresses.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Subscriber.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/TargetType.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/UserAssignedIdentity.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ValidateSchemaResult.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ValidateSchemaStatus.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/package-info.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/package-info.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/module-info.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azuredatatransfer/proxy-config.json create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azuredatatransfer/reflect-config.json create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/resources/azure-resourcemanager-azuredatatransfer.properties create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsDeleteSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsGetByResourceGroupSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsLinkSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsListByResourceGroupSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsListBySubscriptionSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsUpdateSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsCreateOrUpdateSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsDeleteSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsEnableSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGeneratePassphraseSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetDestinationEndpointPortsSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetDestinationEndpointsSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetSourceAddressesSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetStreamConnectionStringSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsLinkSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsListByConnectionSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetDestinationEndpointPortsSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetDestinationEndpointsSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetPassphraseSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetSourceAddressesSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsUpdateSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/OperationsListSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesCreateOrUpdateSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesDeleteSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesExecuteActionSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesGetByResourceGroupSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesListByResourceGroupSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesListBySubscriptionSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesRejectConnectionSamples.java create mode 100644 sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesUpdateSamples.java create mode 100644 sdk/azuredatatransfer/ci.yml create mode 100644 sdk/azuredatatransfer/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 81fae11f6e0e..4d1384396d5c 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -486,6 +486,7 @@ com.azure.resourcemanager:azure-resourcemanager-dell-storage;1.0.0-beta.1;1.0.0- com.azure.resourcemanager:azure-resourcemanager-sitemanager;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-mongodbatlas;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-purestorageblock;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-azuredatatransfer;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 com.azure.v2:azure-client-sdk-parent;2.0.0-beta.1;2.0.0-beta.1 diff --git a/pom.xml b/pom.xml index 1b9befeb6cc9..0c5b4cf3562a 100644 --- a/pom.xml +++ b/pom.xml @@ -30,6 +30,7 @@ sdk/avs sdk/azureadexternalidentities sdk/azurearcdata + sdk/azuredatatransfer sdk/azurestack sdk/azurestackhci sdk/baremetalinfrastructure diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/CHANGELOG.md b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/CHANGELOG.md new file mode 100644 index 000000000000..cde2f3f9ae07 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2025-05-13) + +- Azure Resource Manager Azuredatatransfer client library for Java. This package contains Microsoft Azure SDK for Azuredatatransfer Management SDK. Azure Data Transfer service resource provider. Package tag package-preview-2025-04-11-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-azuredatatransfer Java SDK. diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/README.md b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/README.md new file mode 100644 index 000000000000..1db18648a70e --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Azuredatatransfer client library for Java + +Azure Resource Manager Azuredatatransfer client library for Java. + +This package contains Microsoft Azure SDK for Azuredatatransfer Management SDK. Azure Data Transfer service resource provider. Package tag package-preview-2025-04-11-preview. 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-azuredatatransfer;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-azuredatatransfer + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +AzuredatatransferManager manager = AzuredatatransferManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/SAMPLE.md b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/SAMPLE.md new file mode 100644 index 000000000000..33632cba9ff4 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/SAMPLE.md @@ -0,0 +1,859 @@ +# Code snippets and samples + + +## Connections + +- [CreateOrUpdate](#connections_createorupdate) +- [Delete](#connections_delete) +- [GetByResourceGroup](#connections_getbyresourcegroup) +- [Link](#connections_link) +- [ListByResourceGroup](#connections_listbyresourcegroup) +- [ListBySubscription](#connections_listbysubscription) +- [Update](#connections_update) + +## Flows + +- [CreateOrUpdate](#flows_createorupdate) +- [Delete](#flows_delete) +- [Enable](#flows_enable) +- [GeneratePassphrase](#flows_generatepassphrase) +- [Get](#flows_get) +- [GetDestinationEndpointPorts](#flows_getdestinationendpointports) +- [GetDestinationEndpoints](#flows_getdestinationendpoints) +- [GetSourceAddresses](#flows_getsourceaddresses) +- [GetStreamConnectionString](#flows_getstreamconnectionstring) +- [Link](#flows_link) +- [ListByConnection](#flows_listbyconnection) +- [SetDestinationEndpointPorts](#flows_setdestinationendpointports) +- [SetDestinationEndpoints](#flows_setdestinationendpoints) +- [SetPassphrase](#flows_setpassphrase) +- [SetSourceAddresses](#flows_setsourceaddresses) +- [Update](#flows_update) + +## Operations + +- [List](#operations_list) + +## Pipelines + +- [CreateOrUpdate](#pipelines_createorupdate) +- [Delete](#pipelines_delete) +- [ExecuteAction](#pipelines_executeaction) +- [GetByResourceGroup](#pipelines_getbyresourcegroup) +- [ListByResourceGroup](#pipelines_listbyresourcegroup) +- [ListBySubscription](#pipelines_listbysubscription) +- [RejectConnection](#pipelines_rejectconnection) +- [Update](#pipelines_update) +### Connections_CreateOrUpdate + +```java + +/** + * Samples for Connections Link. + */ +public final class ConnectionsLinkSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * linkConnection.json + */ + /** + * Sample code: Links the specified connection. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + linksTheSpecifiedConnection(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.connections().link("testRG", "testConnection", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Connections_Delete + +```java +import com.azure.resourcemanager.azuredatatransfer.models.Flow; + +/** + * Samples for Flows Update. + */ +public final class FlowsUpdateSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * patchFlow.json + */ + /** + * Sample code: Updates the flow resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + updatesTheFlowResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + Flow resource = manager.flows() + .getWithResponse("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### Connections_GetByResourceGroup + +```java +/** + * Samples for Connections CreateOrUpdate. + */ +public final class ConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * createOrUpdateConnection.json + */ + /** + * Sample code: Creates or updates the connection resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void createsOrUpdatesTheConnectionResource( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.connections() + .define("testConnection") + .withRegion((String) null) + .withExistingResourceGroup("testRG") + .create(); + } +} +``` + +### Connections_Link + +```java +import com.azure.resourcemanager.azuredatatransfer.models.Connection; + +/** + * Samples for Connections Update. + */ +public final class ConnectionsUpdateSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * patchConnection.json + */ + /** + * Sample code: Updates the connection resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + updatesTheConnectionResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + Connection resource = manager.connections() + .getByResourceGroupWithResponse("testRG", "testConnection", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### Connections_ListByResourceGroup + +```java +/** + * Samples for Pipelines ListBySubscription. + */ +public final class PipelinesListBySubscriptionSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * listPipelinesBySubscription.json + */ + /** + * Sample code: Gets pipelines in a subscription. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getsPipelinesInASubscription(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.pipelines().listBySubscription(com.azure.core.util.Context.NONE); + } +} +``` + +### Connections_ListBySubscription + +```java +/** + * Samples for Flows GetStreamConnectionString. + */ +public final class FlowsGetStreamConnectionStringSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * getStreamConnectionString.json + */ + /** + * Sample code: Get the flow stream connection string. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getTheFlowStreamConnectionString(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .getStreamConnectionStringWithResponse("testRG", "testConnection", "testFlow", + com.azure.core.util.Context.NONE); + } +} +``` + +### Connections_Update + +```java +/** + * Samples for Flows GeneratePassphrase. + */ +public final class FlowsGeneratePassphraseSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * generateFlowPassphrase.json + */ + /** + * Sample code: Generate a new compliant streaming passphrase. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void generateANewCompliantStreamingPassphrase( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows().generatePassphrase("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_CreateOrUpdate + +```java +/** + * Samples for Flows Get. + */ +public final class FlowsGetSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * getFlow.json + */ + /** + * Sample code: Gets flow resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void getsFlowResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows().getWithResponse("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_Delete + +```java + +/** + * Samples for Flows SetPassphrase. + */ +public final class FlowsSetPassphraseSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * setFlowPassphrase.json + */ + /** + * Sample code: Set the flow stream passphrase. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + setTheFlowStreamPassphrase(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows().setPassphrase("testRG", "testConnection", "testFlow", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_Enable + +```java +/** + * Samples for Flows GetDestinationEndpoints. + */ +public final class FlowsGetDestinationEndpointsSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * getFlowDestinationEndpoints.json + */ + /** + * Sample code: Get the flow stream destination endpoints. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void getTheFlowStreamDestinationEndpoints( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .getDestinationEndpointsWithResponse("testRG", "testConnection", "testFlow", + com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_GeneratePassphrase + +```java +/** + * Samples for Pipelines CreateOrUpdate. + */ +public final class PipelinesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * createOrUpdatePipeline.json + */ + /** + * Sample code: Creates or updates the pipeline resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void createsOrUpdatesThePipelineResource( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.pipelines() + .define("testPipeline") + .withRegion((String) null) + .withExistingResourceGroup("testRG") + .create(); + } +} +``` + +### Flows_Get + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * listOperations.json + */ + /** + * Sample code: List operations. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void listOperations(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_GetDestinationEndpointPorts + +```java +/** + * Samples for Pipelines GetByResourceGroup. + */ +public final class PipelinesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * getPipeline.json + */ + /** + * Sample code: Gets pipeline resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getsPipelineResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.pipelines().getByResourceGroupWithResponse("testRG", "testPipeline", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_GetDestinationEndpoints + +```java +/** + * Samples for Flows ListByConnection. + */ +public final class FlowsListByConnectionSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * listFlowsByConnection.json + */ + /** + * Sample code: Gets flows in a connection. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getsFlowsInAConnection(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows().listByConnection("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_GetSourceAddresses + +```java + +/** + * Samples for Flows SetSourceAddresses. + */ +public final class FlowsSetSourceAddressesSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * setFlowSourceAddresses.json + */ + /** + * Sample code: Set the flow stream source addresses. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + setTheFlowStreamSourceAddresses(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .setSourceAddresses("testRG", "testConnection", "testFlow", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_GetStreamConnectionString + +```java + +/** + * Samples for Pipelines ExecuteAction. + */ +public final class PipelinesExecuteActionSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * executeAction.json + */ + /** + * Sample code: Executes action for a pipeline. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + executesActionForAPipeline(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.pipelines().executeAction("testRG", "testPipeline", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_Link + +```java +/** + * Samples for Flows Enable. + */ +public final class FlowsEnableSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * enableOrDisableFlow.json + */ + /** + * Sample code: Enables the specified flow. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + enablesTheSpecifiedFlow(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows().enable("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_ListByConnection + +```java +/** + * Samples for Pipelines Delete. + */ +public final class PipelinesDeleteSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * deletePipeline.json + */ + /** + * Sample code: Deletes the pipeline resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + deletesThePipelineResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.pipelines().delete("testRG", "testPipeline", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_SetDestinationEndpointPorts + +```java +/** + * Samples for Pipelines ListByResourceGroup. + */ +public final class PipelinesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * listPipelinesByResourceGroup.json + */ + /** + * Sample code: Gets pipelines in a resource group. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getsPipelinesInAResourceGroup(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.pipelines().listByResourceGroup("testRG", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_SetDestinationEndpoints + +```java +/** + * Samples for Flows GetSourceAddresses. + */ +public final class FlowsGetSourceAddressesSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * getFlowSourceAddresses.json + */ + /** + * Sample code: Get the flow stream source addresses. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getTheFlowStreamSourceAddresses(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .getSourceAddressesWithResponse("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_SetPassphrase + +```java +/** + * Samples for Flows Delete. + */ +public final class FlowsDeleteSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * deleteFlow.json + */ + /** + * Sample code: Deletes the flow resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + deletesTheFlowResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows().delete("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_SetSourceAddresses + +```java +/** + * Samples for Connections ListByResourceGroup. + */ +public final class ConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * listConnectionsByResourceGroup.json + */ + /** + * Sample code: Gets connections in a resource group. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getsConnectionsInAResourceGroup(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.connections().listByResourceGroup("testRG", com.azure.core.util.Context.NONE); + } +} +``` + +### Flows_Update + +```java +/** + * Samples for Connections ListBySubscription. + */ +public final class ConnectionsListBySubscriptionSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * listConnectionsBySubscription.json + */ + /** + * Sample code: Gets connections in a subscription. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getsConnectionsInASubscription(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.connections().listBySubscription(com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Connections Delete. + */ +public final class ConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * deleteConnection.json + */ + /** + * Sample code: Deletes the connection resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + deletesTheConnectionResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.connections().delete("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_CreateOrUpdate + +```java + +/** + * Samples for Flows Link. + */ +public final class FlowsLinkSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * linkFlow.json + */ + /** + * Sample code: Links the specified flow. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + linksTheSpecifiedFlow(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows().link("testRG", "testConnection", "testFlow", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_Delete + +```java +/** + * Samples for Flows CreateOrUpdate. + */ +public final class FlowsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * createOrUpdateFlow.json + */ + /** + * Sample code: Creates or updates the flow resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + createsOrUpdatesTheFlowResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .define("testFlow") + .withRegion((String) null) + .withExistingConnection("testRG", "testConnection") + .create(); + } +} +``` + +### Pipelines_ExecuteAction + +```java +/** + * Samples for Flows GetDestinationEndpointPorts. + */ +public final class FlowsGetDestinationEndpointPortsSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * getFlowDestinationEndpointPorts.json + */ + /** + * Sample code: Get the flow stream destination endpoint ports. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void getTheFlowStreamDestinationEndpointPorts( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .getDestinationEndpointPortsWithResponse("testRG", "testConnection", "testFlow", + com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_GetByResourceGroup + +```java +/** + * Samples for Connections GetByResourceGroup. + */ +public final class ConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * getConnection.json + */ + /** + * Sample code: Gets connection resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getsConnectionResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.connections() + .getByResourceGroupWithResponse("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_ListByResourceGroup + +```java +import com.azure.resourcemanager.azuredatatransfer.models.Pipeline; + +/** + * Samples for Pipelines Update. + */ +public final class PipelinesUpdateSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * patchPipeline.json + */ + /** + * Sample code: Updates the pipeline resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + updatesThePipelineResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + Pipeline resource = manager.pipelines() + .getByResourceGroupWithResponse("testRG", "testPipeline", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} +``` + +### Pipelines_ListBySubscription + +```java + +/** + * Samples for Flows SetDestinationEndpoints. + */ +public final class FlowsSetDestinationEndpointsSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * setFlowDestinationEndpoints.json + */ + /** + * Sample code: Set the flow stream destination endpoints. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void setTheFlowStreamDestinationEndpoints( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .setDestinationEndpoints("testRG", "testConnection", "testFlow", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_RejectConnection + +```java + +/** + * Samples for Flows SetDestinationEndpointPorts. + */ +public final class FlowsSetDestinationEndpointPortsSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * setFlowDestinationEndpointPorts.json + */ + /** + * Sample code: Set the flow stream destination endpoint ports. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void setTheFlowStreamDestinationEndpointPorts( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .setDestinationEndpointPorts("testRG", "testConnection", "testFlow", null, + com.azure.core.util.Context.NONE); + } +} +``` + +### Pipelines_Update + +```java + +/** + * Samples for Pipelines RejectConnection. + */ +public final class PipelinesRejectConnectionSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * approveOrRejectConnection.json + */ + /** + * Sample code: Rejects the specified connection in a pipeline. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void rejectsTheSpecifiedConnectionInAPipeline( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.pipelines().rejectConnection("testRG", "testPipeline", null, com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/pom.xml b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/pom.xml new file mode 100644 index 000000000000..a3de09584530 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-azuredatatransfer + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Azuredatatransfer Management + This package contains Microsoft Azure SDK for Azuredatatransfer Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Data Transfer service resource provider. Package tag package-preview-2025-04-11-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.55.3 + + + com.azure + azure-core-management + 1.17.0 + + + diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/AzuredatatransferManager.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/AzuredatatransferManager.java new file mode 100644 index 000000000000..256439763f94 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/AzuredatatransferManager.java @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azuredatatransfer.fluent.Azuredatatransferrp; +import com.azure.resourcemanager.azuredatatransfer.implementation.AzureDataTransfersImpl; +import com.azure.resourcemanager.azuredatatransfer.implementation.AzuredatatransferrpBuilder; +import com.azure.resourcemanager.azuredatatransfer.implementation.ConnectionsImpl; +import com.azure.resourcemanager.azuredatatransfer.implementation.FlowsImpl; +import com.azure.resourcemanager.azuredatatransfer.implementation.OperationsImpl; +import com.azure.resourcemanager.azuredatatransfer.implementation.PipelinesImpl; +import com.azure.resourcemanager.azuredatatransfer.models.AzureDataTransfers; +import com.azure.resourcemanager.azuredatatransfer.models.Connections; +import com.azure.resourcemanager.azuredatatransfer.models.Flows; +import com.azure.resourcemanager.azuredatatransfer.models.Operations; +import com.azure.resourcemanager.azuredatatransfer.models.Pipelines; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to AzuredatatransferManager. + * Azure Data Transfer service resource provider. + */ +public final class AzuredatatransferManager { + private AzureDataTransfers azureDataTransfers; + + private Operations operations; + + private Connections connections; + + private Pipelines pipelines; + + private Flows flows; + + private final Azuredatatransferrp clientObject; + + private AzuredatatransferManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new AzuredatatransferrpBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Azuredatatransfer service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Azuredatatransfer service API instance. + */ + public static AzuredatatransferManager 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 Azuredatatransfer service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Azuredatatransfer service API instance. + */ + public static AzuredatatransferManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new AzuredatatransferManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create AzuredatatransferManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new AzuredatatransferManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-azuredatatransfer.properties"); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Azuredatatransfer service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Azuredatatransfer service API instance. + */ + public AzuredatatransferManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.azuredatatransfer") + .append("/") + .append(clientVersion); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new AzuredatatransferManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of AzureDataTransfers. + * + * @return Resource collection API of AzureDataTransfers. + */ + public AzureDataTransfers azureDataTransfers() { + if (this.azureDataTransfers == null) { + this.azureDataTransfers = new AzureDataTransfersImpl(clientObject.getAzureDataTransfers(), this); + } + return azureDataTransfers; + } + + /** + * 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 Connections. It manages Connection. + * + * @return Resource collection API of Connections. + */ + public Connections connections() { + if (this.connections == null) { + this.connections = new ConnectionsImpl(clientObject.getConnections(), this); + } + return connections; + } + + /** + * Gets the resource collection API of Pipelines. It manages Pipeline. + * + * @return Resource collection API of Pipelines. + */ + public Pipelines pipelines() { + if (this.pipelines == null) { + this.pipelines = new PipelinesImpl(clientObject.getPipelines(), this); + } + return pipelines; + } + + /** + * Gets the resource collection API of Flows. It manages Flow. + * + * @return Resource collection API of Flows. + */ + public Flows flows() { + if (this.flows == null) { + this.flows = new FlowsImpl(clientObject.getFlows(), this); + } + return flows; + } + + /** + * Gets wrapped service client Azuredatatransferrp providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client Azuredatatransferrp. + */ + public Azuredatatransferrp serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/AzureDataTransfersClient.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/AzureDataTransfersClient.java new file mode 100644 index 000000000000..798dc2a9dc28 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/AzureDataTransfersClient.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.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.azuredatatransfer.fluent.models.SchemasListResultInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ValidateSchemaResultInner; +import com.azure.resourcemanager.azuredatatransfer.models.ListApprovedSchemasRequest; +import com.azure.resourcemanager.azuredatatransfer.models.Schema; + +/** + * An instance of this class provides access to all the operations defined in AzureDataTransfersClient. + */ +public interface AzureDataTransfersClient { + /** + * Lists approved schemas for Azure Data Transfer. + * + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listApprovedSchemasWithResponse(ListApprovedSchemasRequest body, Context context); + + /** + * Lists approved schemas for Azure Data Transfer. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SchemasListResultInner listApprovedSchemas(ListApprovedSchemasRequest body); + + /** + * Validates a schema for Azure Data Transfer. + * + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the schema validation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateSchemaWithResponse(Schema body, Context context); + + /** + * Validates a schema for Azure Data Transfer. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the schema validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateSchemaResultInner validateSchema(Schema body); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/Azuredatatransferrp.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/Azuredatatransferrp.java new file mode 100644 index 000000000000..fc82db85337c --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/Azuredatatransferrp.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for Azuredatatransferrp class. + */ +public interface Azuredatatransferrp { + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @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 AzureDataTransfersClient object to access its operations. + * + * @return the AzureDataTransfersClient object. + */ + AzureDataTransfersClient getAzureDataTransfers(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the ConnectionsClient object to access its operations. + * + * @return the ConnectionsClient object. + */ + ConnectionsClient getConnections(); + + /** + * Gets the PipelinesClient object to access its operations. + * + * @return the PipelinesClient object. + */ + PipelinesClient getPipelines(); + + /** + * Gets the FlowsClient object to access its operations. + * + * @return the FlowsClient object. + */ + FlowsClient getFlows(); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/ConnectionsClient.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/ConnectionsClient.java new file mode 100644 index 000000000000..d72abf3e5988 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/ConnectionsClient.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.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.azuredatatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PendingConnectionInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PendingFlowInner; +import com.azure.resourcemanager.azuredatatransfer.models.ConnectionsPatch; +import com.azure.resourcemanager.azuredatatransfer.models.ResourceBody; + +/** + * An instance of this class provides access to all the operations defined in ConnectionsClient. + */ +public interface ConnectionsClient { + /** + * Gets connections in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(); + + /** + * Gets connections in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(Context context); + + /** + * Gets connections in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets connections in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String connectionName, + Context context); + + /** + * Gets connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionInner getByResourceGroup(String resourceGroupName, String connectionName); + + /** + * Creates or updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param resource Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String connectionName, + ConnectionInner resource, Context context); + + /** + * Creates or updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param resource Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionInner createOrUpdate(String resourceGroupName, String connectionName, ConnectionInner resource); + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param properties Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectionInner> beginUpdate(String resourceGroupName, + String connectionName, ConnectionsPatch properties); + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param properties Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectionInner> beginUpdate(String resourceGroupName, + String connectionName, ConnectionsPatch properties, Context context); + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param properties Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionInner update(String resourceGroupName, String connectionName, ConnectionsPatch properties); + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param properties Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionInner update(String resourceGroupName, String connectionName, ConnectionsPatch properties, + Context context); + + /** + * Deletes the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 connectionName); + + /** + * Deletes the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 connectionName, Context context); + + /** + * Deletes the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String connectionName); + + /** + * Deletes the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String connectionName, Context context); + + /** + * Links the connection to its pending connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectionInner> beginLink(String resourceGroupName, String connectionName, + ResourceBody body); + + /** + * Links the connection to its pending connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectionInner> beginLink(String resourceGroupName, String connectionName, + ResourceBody body, Context context); + + /** + * Links the connection to its pending connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionInner link(String resourceGroupName, String connectionName, ResourceBody body); + + /** + * Links the connection to its pending connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionInner link(String resourceGroupName, String connectionName, ResourceBody body, Context context); + + /** + * Lists all pending connections for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingConnection list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String connectionName); + + /** + * Lists all pending connections for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingConnection list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String connectionName, Context context); + + /** + * Lists all pending flows for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingFlow list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPendingFlowsList(String resourceGroupName, String connectionName); + + /** + * Lists all pending flows for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingFlow list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPendingFlowsList(String resourceGroupName, String connectionName, + Context context); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/FlowsClient.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/FlowsClient.java new file mode 100644 index 000000000000..2eb3779ca08a --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/FlowsClient.java @@ -0,0 +1,871 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.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.azuredatatransfer.fluent.models.FlowInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.GetDestinationEndpointPortsResultInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.GetDestinationEndpointsResultInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.GetStreamConnectionStringResultInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.StreamSourceAddressesInner; +import com.azure.resourcemanager.azuredatatransfer.models.FlowsPatch; +import com.azure.resourcemanager.azuredatatransfer.models.ResourceBody; +import com.azure.resourcemanager.azuredatatransfer.models.SetDestinationEndpointPorts; +import com.azure.resourcemanager.azuredatatransfer.models.SetDestinationEndpoints; +import com.azure.resourcemanager.azuredatatransfer.models.SetSourceAddresses; +import com.azure.resourcemanager.azuredatatransfer.models.SetStreamPassphrase; + +/** + * An instance of this class provides access to all the operations defined in FlowsClient. + */ +public interface FlowsClient { + /** + * Gets flows in a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flows in a connection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByConnection(String resourceGroupName, String connectionName); + + /** + * Gets flows in a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flows in a connection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByConnection(String resourceGroupName, String connectionName, Context context); + + /** + * Gets flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flow resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String connectionName, String flowName, + Context context); + + /** + * Gets flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flow resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner get(String resourceGroupName, String connectionName, String flowName); + + /** + * Creates or updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param resource Flow body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String connectionName, String flowName, + FlowInner resource, Context context); + + /** + * Creates or updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param resource Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner createOrUpdate(String resourceGroupName, String connectionName, String flowName, FlowInner resource); + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param properties Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginUpdate(String resourceGroupName, String connectionName, + String flowName, FlowsPatch properties); + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param properties Flow body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginUpdate(String resourceGroupName, String connectionName, + String flowName, FlowsPatch properties, Context context); + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param properties Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner update(String resourceGroupName, String connectionName, String flowName, FlowsPatch properties); + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param properties Flow body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner update(String resourceGroupName, String connectionName, String flowName, FlowsPatch properties, + Context context); + + /** + * Deletes the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 connectionName, String flowName); + + /** + * Deletes the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 connectionName, String flowName, + Context context); + + /** + * Deletes the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String connectionName, String flowName); + + /** + * Deletes the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String connectionName, String flowName, Context context); + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginDisable(String resourceGroupName, String connectionName, + String flowName); + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginDisable(String resourceGroupName, String connectionName, + String flowName, Context context); + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner disable(String resourceGroupName, String connectionName, String flowName); + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner disable(String resourceGroupName, String connectionName, String flowName, Context context); + + /** + * Enables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginEnable(String resourceGroupName, String connectionName, + String flowName); + + /** + * Enables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginEnable(String resourceGroupName, String connectionName, + String flowName, Context context); + + /** + * Enables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner enable(String resourceGroupName, String connectionName, String flowName); + + /** + * Enables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner enable(String resourceGroupName, String connectionName, String flowName, Context context); + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginGeneratePassphrase(String resourceGroupName, + String connectionName, String flowName); + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginGeneratePassphrase(String resourceGroupName, + String connectionName, String flowName, Context context); + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner generatePassphrase(String resourceGroupName, String connectionName, String flowName); + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner generatePassphrase(String resourceGroupName, String connectionName, String flowName, Context context); + + /** + * Get the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoint ports for the specified flow and stream ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDestinationEndpointPortsWithResponse(String resourceGroupName, + String connectionName, String flowName, Context context); + + /** + * Get the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoint ports for the specified flow and stream ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetDestinationEndpointPortsResultInner getDestinationEndpointPorts(String resourceGroupName, String connectionName, + String flowName); + + /** + * Get the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoints for the specified flow and stream ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDestinationEndpointsWithResponse(String resourceGroupName, + String connectionName, String flowName, Context context); + + /** + * Get the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoints for the specified flow and stream ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetDestinationEndpointsResultInner getDestinationEndpoints(String resourceGroupName, String connectionName, + String flowName); + + /** + * Get the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source addresses for the specified flow along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSourceAddressesWithResponse(String resourceGroupName, String connectionName, + String flowName, Context context); + + /** + * Get the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source addresses for the specified flow. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StreamSourceAddressesInner getSourceAddresses(String resourceGroupName, String connectionName, String flowName); + + /** + * Get the connection string for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection string for the specified flow along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getStreamConnectionStringWithResponse(String resourceGroupName, + String connectionName, String flowName, Context context); + + /** + * Get the connection string for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection string for the specified flow. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetStreamConnectionStringResultInner getStreamConnectionString(String resourceGroupName, String connectionName, + String flowName); + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginLink(String resourceGroupName, String connectionName, + String flowName, ResourceBody body); + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Flow body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginLink(String resourceGroupName, String connectionName, + String flowName, ResourceBody body, Context context); + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner link(String resourceGroupName, String connectionName, String flowName, ResourceBody body); + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Flow body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner link(String resourceGroupName, String connectionName, String flowName, ResourceBody body, + Context context); + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoint ports wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginSetDestinationEndpointPorts(String resourceGroupName, + String connectionName, String flowName, SetDestinationEndpointPorts body); + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoint ports wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginSetDestinationEndpointPorts(String resourceGroupName, + String connectionName, String flowName, SetDestinationEndpointPorts body, Context context); + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoint ports wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner setDestinationEndpointPorts(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpointPorts body); + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoint ports wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner setDestinationEndpointPorts(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpointPorts body, Context context); + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoints wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginSetDestinationEndpoints(String resourceGroupName, + String connectionName, String flowName, SetDestinationEndpoints body); + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoints wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginSetDestinationEndpoints(String resourceGroupName, + String connectionName, String flowName, SetDestinationEndpoints body, Context context); + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoints wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner setDestinationEndpoints(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpoints body); + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoints wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner setDestinationEndpoints(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpoints body, Context context); + + /** + * Sets the passphrase of the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Passphrase to set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginSetPassphrase(String resourceGroupName, String connectionName, + String flowName, SetStreamPassphrase body); + + /** + * Sets the passphrase of the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Passphrase to set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginSetPassphrase(String resourceGroupName, String connectionName, + String flowName, SetStreamPassphrase body, Context context); + + /** + * Sets the passphrase of the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Passphrase to set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner setPassphrase(String resourceGroupName, String connectionName, String flowName, SetStreamPassphrase body); + + /** + * Sets the passphrase of the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Passphrase to set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner setPassphrase(String resourceGroupName, String connectionName, String flowName, SetStreamPassphrase body, + Context context); + + /** + * Set the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Source addresses wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginSetSourceAddresses(String resourceGroupName, + String connectionName, String flowName, SetSourceAddresses body); + + /** + * Set the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Source addresses wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, FlowInner> beginSetSourceAddresses(String resourceGroupName, + String connectionName, String flowName, SetSourceAddresses body, Context context); + + /** + * Set the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Source addresses wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner setSourceAddresses(String resourceGroupName, String connectionName, String flowName, + SetSourceAddresses body); + + /** + * Set the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Source addresses wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FlowInner setSourceAddresses(String resourceGroupName, String connectionName, String flowName, + SetSourceAddresses body, Context context); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/OperationsClient.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/OperationsClient.java new file mode 100644 index 000000000000..4a1a7639f5e8 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/OperationsClient.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.azuredatatransfer.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.azuredatatransfer.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/PipelinesClient.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/PipelinesClient.java new file mode 100644 index 000000000000..e00f02f9046e --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/PipelinesClient.java @@ -0,0 +1,515 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.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.azuredatatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ListFlowsByPipelineResultInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PipelineInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.SchemasListResultInner; +import com.azure.resourcemanager.azuredatatransfer.models.Action; +import com.azure.resourcemanager.azuredatatransfer.models.ConnectionIdList; +import com.azure.resourcemanager.azuredatatransfer.models.PipelinesPatch; +import com.azure.resourcemanager.azuredatatransfer.models.ResourceBody; +import com.azure.resourcemanager.azuredatatransfer.models.Schema; + +/** + * An instance of this class provides access to all the operations defined in PipelinesClient. + */ +public interface PipelinesClient { + /** + * Gets pipelines in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(); + + /** + * Gets pipelines in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(Context context); + + /** + * Gets pipelines in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets pipelines in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipeline resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String pipelineName, + Context context); + + /** + * Gets pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipeline resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PipelineInner getByResourceGroup(String resourceGroupName, String pipelineName); + + /** + * Creates or updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param resource Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PipelineInner> beginCreateOrUpdate(String resourceGroupName, + String pipelineName, PipelineInner resource); + + /** + * Creates or updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param resource Pipeline body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PipelineInner> beginCreateOrUpdate(String resourceGroupName, + String pipelineName, PipelineInner resource, Context context); + + /** + * Creates or updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param resource Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PipelineInner createOrUpdate(String resourceGroupName, String pipelineName, PipelineInner resource); + + /** + * Creates or updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param resource Pipeline body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PipelineInner createOrUpdate(String resourceGroupName, String pipelineName, PipelineInner resource, + Context context); + + /** + * Updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param properties Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PipelineInner> beginUpdate(String resourceGroupName, String pipelineName, + PipelinesPatch properties); + + /** + * Updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param properties Pipeline body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PipelineInner> beginUpdate(String resourceGroupName, String pipelineName, + PipelinesPatch properties, Context context); + + /** + * Updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param properties Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PipelineInner update(String resourceGroupName, String pipelineName, PipelinesPatch properties); + + /** + * Updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param properties Pipeline body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PipelineInner update(String resourceGroupName, String pipelineName, PipelinesPatch properties, Context context); + + /** + * Deletes the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 pipelineName); + + /** + * Deletes the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 pipelineName, Context context); + + /** + * Deletes the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String pipelineName); + + /** + * Deletes the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String pipelineName, Context context); + + /** + * Approves the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectionInner> beginApproveConnection(String resourceGroupName, + String pipelineName, ResourceBody body); + + /** + * Approves the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectionInner> beginApproveConnection(String resourceGroupName, + String pipelineName, ResourceBody body, Context context); + + /** + * Approves the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionInner approveConnection(String resourceGroupName, String pipelineName, ResourceBody body); + + /** + * Approves the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionInner approveConnection(String resourceGroupName, String pipelineName, ResourceBody body, + Context context); + + /** + * Executes a privileged action for a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Action to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PipelineInner> beginExecuteAction(String resourceGroupName, + String pipelineName, Action body); + + /** + * Executes a privileged action for a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Action to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PipelineInner> beginExecuteAction(String resourceGroupName, + String pipelineName, Action body, Context context); + + /** + * Executes a privileged action for a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Action to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PipelineInner executeAction(String resourceGroupName, String pipelineName, Action body); + + /** + * Executes a privileged action for a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Action to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PipelineInner executeAction(String resourceGroupName, String pipelineName, Action body, Context context); + + /** + * Lists the flows in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param connections Connection(s) to retrieve flows of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of flow resources along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String pipelineName, + ConnectionIdList connections, Context context); + + /** + * Lists the flows in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of flow resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ListFlowsByPipelineResultInner list(String resourceGroupName, String pipelineName); + + /** + * Lists the schemas for the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Schema(s) to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSchemasListWithResponse(String resourceGroupName, String pipelineName, + Schema body, Context context); + + /** + * Lists the schemas for the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Schema(s) to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SchemasListResultInner listSchemasList(String resourceGroupName, String pipelineName, Schema body); + + /** + * Rejects the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectionInner> beginRejectConnection(String resourceGroupName, + String pipelineName, ResourceBody body); + + /** + * Rejects the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConnectionInner> beginRejectConnection(String resourceGroupName, + String pipelineName, ResourceBody body, Context context); + + /** + * Rejects the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionInner rejectConnection(String resourceGroupName, String pipelineName, ResourceBody body); + + /** + * Rejects the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionInner rejectConnection(String resourceGroupName, String pipelineName, ResourceBody body, Context context); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/ConnectionInner.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/ConnectionInner.java new file mode 100644 index 000000000000..1d323d235b47 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/ConnectionInner.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.models.ConnectionProperties; +import com.azure.resourcemanager.azuredatatransfer.models.ManagedServiceIdentity; +import java.io.IOException; +import java.util.Map; + +/** + * The connection resource definition. + */ +@Fluent +public final class ConnectionInner extends Resource { + /* + * Properties of connection + */ + private ConnectionProperties properties; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ConnectionInner class. + */ + public ConnectionInner() { + } + + /** + * Get the properties property: Properties of connection. + * + * @return the properties value. + */ + public ConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of connection. + * + * @param properties the properties value to set. + * @return the ConnectionInner object itself. + */ + public ConnectionInner withProperties(ConnectionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the ConnectionInner object itself. + */ + public ConnectionInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ConnectionInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ConnectionInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectionInner. + */ + public static ConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionInner deserializedConnectionInner = new ConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedConnectionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedConnectionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectionInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedConnectionInner.properties = ConnectionProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedConnectionInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedConnectionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionInner; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/FlowInner.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/FlowInner.java new file mode 100644 index 000000000000..0f58ff49f081 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/FlowInner.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.azuredatatransfer.models.Plan; +import java.io.IOException; +import java.util.Map; + +/** + * The flow resource definition. + */ +@Fluent +public final class FlowInner extends Resource { + /* + * Properties of flow + */ + private FlowPropertiesInner properties; + + /* + * Details of the resource plan. + */ + private Plan plan; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of FlowInner class. + */ + public FlowInner() { + } + + /** + * Get the properties property: Properties of flow. + * + * @return the properties value. + */ + public FlowPropertiesInner properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of flow. + * + * @param properties the properties value to set. + * @return the FlowInner object itself. + */ + public FlowInner withProperties(FlowPropertiesInner properties) { + this.properties = properties; + return this; + } + + /** + * Get the plan property: Details of the resource plan. + * + * @return the plan value. + */ + public Plan plan() { + return this.plan; + } + + /** + * Set the plan property: Details of the resource plan. + * + * @param plan the plan value to set. + * @return the FlowInner object itself. + */ + public FlowInner withPlan(Plan plan) { + this.plan = plan; + return this; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the FlowInner object itself. + */ + public FlowInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public FlowInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FlowInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (plan() != null) { + plan().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("plan", this.plan); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FlowInner. + */ + public static FlowInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowInner deserializedFlowInner = new FlowInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFlowInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFlowInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFlowInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedFlowInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFlowInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedFlowInner.properties = FlowPropertiesInner.fromJson(reader); + } else if ("plan".equals(fieldName)) { + deserializedFlowInner.plan = Plan.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedFlowInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFlowInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowInner; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/FlowPropertiesInner.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/FlowPropertiesInner.java new file mode 100644 index 000000000000..48f493899d02 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/FlowPropertiesInner.java @@ -0,0 +1,853 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.models.ApiFlowOptions; +import com.azure.resourcemanager.azuredatatransfer.models.DataType; +import com.azure.resourcemanager.azuredatatransfer.models.FlowStatus; +import com.azure.resourcemanager.azuredatatransfer.models.FlowType; +import com.azure.resourcemanager.azuredatatransfer.models.ForceDisabledStatus; +import com.azure.resourcemanager.azuredatatransfer.models.LinkStatus; +import com.azure.resourcemanager.azuredatatransfer.models.MessagingOptions; +import com.azure.resourcemanager.azuredatatransfer.models.ProvisioningState; +import com.azure.resourcemanager.azuredatatransfer.models.Schema; +import com.azure.resourcemanager.azuredatatransfer.models.SelectedResource; +import com.azure.resourcemanager.azuredatatransfer.models.StreamProtocol; +import java.io.IOException; +import java.util.List; + +/** + * Properties of flow. + */ +@Fluent +public final class FlowPropertiesInner implements JsonSerializable { + /* + * The connection associated with this flow + */ + private SelectedResource connection; + + /* + * Dataflow GUID associated with this flow + */ + private String flowId; + + /* + * AME, PME, or TORUS only! AKV Chain Containing SAS Token + */ + private String keyVaultUri; + + /* + * Link status of the current flow + */ + private LinkStatus linkStatus; + + /* + * Resource ID of the linked flow + */ + private String linkedFlowId; + + /* + * Status of the current flow + */ + private FlowStatus status; + + /* + * Force disablement status of the current flow + */ + private List forceDisabledStatus; + + /* + * Storage Account + */ + private String storageAccountName; + + /* + * Storage Account ID + */ + private String storageAccountId; + + /* + * Storage Container Name + */ + private String storageContainerName; + + /* + * Storage Table Name + */ + private String storageTableName; + + /* + * Service Bus Queue ID + */ + private String serviceBusQueueId; + + /* + * The flow type for this flow + */ + private FlowType flowType; + + /* + * Transfer Storage Blobs or Tables + */ + private DataType dataType; + + /* + * Provisioning state of the flow + */ + private ProvisioningState provisioningState; + + /* + * The policies for this flow + */ + private List policies; + + /* + * The selected schema for this flow + */ + private Schema schema; + + /* + * The messaging options for this flow + */ + private MessagingOptions messagingOptions; + + /* + * The API Flow configuration options for Azure Data Transfer API Flow type. + */ + private ApiFlowOptions apiFlowOptions; + + /* + * The URI to the customer managed key for this flow + */ + private String customerManagedKeyVaultUri; + + /* + * The flow stream identifier + */ + private String streamId; + + /* + * The protocol of the stream + */ + private StreamProtocol streamProtocol; + + /* + * The latency of the stream in milliseconds + */ + private Long streamLatency; + + /* + * The passphrase used for SRT streams + */ + private String passphrase; + + /* + * The source IP address and CIDR ranges of the stream + */ + private StreamSourceAddressesInner sourceAddresses; + + /* + * The destination endpoints of the stream + */ + private List destinationEndpoints; + + /* + * The destination endpoint ports of the stream + */ + private List destinationEndpointPorts; + + /* + * Event Hub ID + */ + private String eventHubId; + + /* + * Event Hub Consumer Group + */ + private String consumerGroup; + + /** + * Creates an instance of FlowPropertiesInner class. + */ + public FlowPropertiesInner() { + } + + /** + * Get the connection property: The connection associated with this flow. + * + * @return the connection value. + */ + public SelectedResource connection() { + return this.connection; + } + + /** + * Set the connection property: The connection associated with this flow. + * + * @param connection the connection value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withConnection(SelectedResource connection) { + this.connection = connection; + return this; + } + + /** + * Get the flowId property: Dataflow GUID associated with this flow. + * + * @return the flowId value. + */ + public String flowId() { + return this.flowId; + } + + /** + * Get the keyVaultUri property: AME, PME, or TORUS only! AKV Chain Containing SAS Token. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: AME, PME, or TORUS only! AKV Chain Containing SAS Token. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the linkStatus property: Link status of the current flow. + * + * @return the linkStatus value. + */ + public LinkStatus linkStatus() { + return this.linkStatus; + } + + /** + * Get the linkedFlowId property: Resource ID of the linked flow. + * + * @return the linkedFlowId value. + */ + public String linkedFlowId() { + return this.linkedFlowId; + } + + /** + * Get the status property: Status of the current flow. + * + * @return the status value. + */ + public FlowStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the current flow. + * + * @param status the status value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withStatus(FlowStatus status) { + this.status = status; + return this; + } + + /** + * Get the forceDisabledStatus property: Force disablement status of the current flow. + * + * @return the forceDisabledStatus value. + */ + public List forceDisabledStatus() { + return this.forceDisabledStatus; + } + + /** + * Get the storageAccountName property: Storage Account. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the storageAccountName property: Storage Account. + * + * @param storageAccountName the storageAccountName value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storageAccountId property: Storage Account ID. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: Storage Account ID. + * + * @param storageAccountId the storageAccountId value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the storageContainerName property: Storage Container Name. + * + * @return the storageContainerName value. + */ + public String storageContainerName() { + return this.storageContainerName; + } + + /** + * Set the storageContainerName property: Storage Container Name. + * + * @param storageContainerName the storageContainerName value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withStorageContainerName(String storageContainerName) { + this.storageContainerName = storageContainerName; + return this; + } + + /** + * Get the storageTableName property: Storage Table Name. + * + * @return the storageTableName value. + */ + public String storageTableName() { + return this.storageTableName; + } + + /** + * Set the storageTableName property: Storage Table Name. + * + * @param storageTableName the storageTableName value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withStorageTableName(String storageTableName) { + this.storageTableName = storageTableName; + return this; + } + + /** + * Get the serviceBusQueueId property: Service Bus Queue ID. + * + * @return the serviceBusQueueId value. + */ + public String serviceBusQueueId() { + return this.serviceBusQueueId; + } + + /** + * Set the serviceBusQueueId property: Service Bus Queue ID. + * + * @param serviceBusQueueId the serviceBusQueueId value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withServiceBusQueueId(String serviceBusQueueId) { + this.serviceBusQueueId = serviceBusQueueId; + return this; + } + + /** + * Get the flowType property: The flow type for this flow. + * + * @return the flowType value. + */ + public FlowType flowType() { + return this.flowType; + } + + /** + * Set the flowType property: The flow type for this flow. + * + * @param flowType the flowType value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withFlowType(FlowType flowType) { + this.flowType = flowType; + return this; + } + + /** + * Get the dataType property: Transfer Storage Blobs or Tables. + * + * @return the dataType value. + */ + public DataType dataType() { + return this.dataType; + } + + /** + * Set the dataType property: Transfer Storage Blobs or Tables. + * + * @param dataType the dataType value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withDataType(DataType dataType) { + this.dataType = dataType; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the flow. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the policies property: The policies for this flow. + * + * @return the policies value. + */ + public List policies() { + return this.policies; + } + + /** + * Set the policies property: The policies for this flow. + * + * @param policies the policies value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withPolicies(List policies) { + this.policies = policies; + return this; + } + + /** + * Get the schema property: The selected schema for this flow. + * + * @return the schema value. + */ + public Schema schema() { + return this.schema; + } + + /** + * Set the schema property: The selected schema for this flow. + * + * @param schema the schema value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withSchema(Schema schema) { + this.schema = schema; + return this; + } + + /** + * Get the messagingOptions property: The messaging options for this flow. + * + * @return the messagingOptions value. + */ + public MessagingOptions messagingOptions() { + return this.messagingOptions; + } + + /** + * Set the messagingOptions property: The messaging options for this flow. + * + * @param messagingOptions the messagingOptions value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withMessagingOptions(MessagingOptions messagingOptions) { + this.messagingOptions = messagingOptions; + return this; + } + + /** + * Get the apiFlowOptions property: The API Flow configuration options for Azure Data Transfer API Flow type. + * + * @return the apiFlowOptions value. + */ + public ApiFlowOptions apiFlowOptions() { + return this.apiFlowOptions; + } + + /** + * Set the apiFlowOptions property: The API Flow configuration options for Azure Data Transfer API Flow type. + * + * @param apiFlowOptions the apiFlowOptions value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withApiFlowOptions(ApiFlowOptions apiFlowOptions) { + this.apiFlowOptions = apiFlowOptions; + return this; + } + + /** + * Get the customerManagedKeyVaultUri property: The URI to the customer managed key for this flow. + * + * @return the customerManagedKeyVaultUri value. + */ + public String customerManagedKeyVaultUri() { + return this.customerManagedKeyVaultUri; + } + + /** + * Set the customerManagedKeyVaultUri property: The URI to the customer managed key for this flow. + * + * @param customerManagedKeyVaultUri the customerManagedKeyVaultUri value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withCustomerManagedKeyVaultUri(String customerManagedKeyVaultUri) { + this.customerManagedKeyVaultUri = customerManagedKeyVaultUri; + return this; + } + + /** + * Get the streamId property: The flow stream identifier. + * + * @return the streamId value. + */ + public String streamId() { + return this.streamId; + } + + /** + * Set the streamId property: The flow stream identifier. + * + * @param streamId the streamId value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withStreamId(String streamId) { + this.streamId = streamId; + return this; + } + + /** + * Get the streamProtocol property: The protocol of the stream. + * + * @return the streamProtocol value. + */ + public StreamProtocol streamProtocol() { + return this.streamProtocol; + } + + /** + * Set the streamProtocol property: The protocol of the stream. + * + * @param streamProtocol the streamProtocol value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withStreamProtocol(StreamProtocol streamProtocol) { + this.streamProtocol = streamProtocol; + return this; + } + + /** + * Get the streamLatency property: The latency of the stream in milliseconds. + * + * @return the streamLatency value. + */ + public Long streamLatency() { + return this.streamLatency; + } + + /** + * Set the streamLatency property: The latency of the stream in milliseconds. + * + * @param streamLatency the streamLatency value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withStreamLatency(Long streamLatency) { + this.streamLatency = streamLatency; + return this; + } + + /** + * Get the passphrase property: The passphrase used for SRT streams. + * + * @return the passphrase value. + */ + public String passphrase() { + return this.passphrase; + } + + /** + * Set the passphrase property: The passphrase used for SRT streams. + * + * @param passphrase the passphrase value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withPassphrase(String passphrase) { + this.passphrase = passphrase; + return this; + } + + /** + * Get the sourceAddresses property: The source IP address and CIDR ranges of the stream. + * + * @return the sourceAddresses value. + */ + public StreamSourceAddressesInner sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: The source IP address and CIDR ranges of the stream. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withSourceAddresses(StreamSourceAddressesInner sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationEndpoints property: The destination endpoints of the stream. + * + * @return the destinationEndpoints value. + */ + public List destinationEndpoints() { + return this.destinationEndpoints; + } + + /** + * Set the destinationEndpoints property: The destination endpoints of the stream. + * + * @param destinationEndpoints the destinationEndpoints value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withDestinationEndpoints(List destinationEndpoints) { + this.destinationEndpoints = destinationEndpoints; + return this; + } + + /** + * Get the destinationEndpointPorts property: The destination endpoint ports of the stream. + * + * @return the destinationEndpointPorts value. + */ + public List destinationEndpointPorts() { + return this.destinationEndpointPorts; + } + + /** + * Set the destinationEndpointPorts property: The destination endpoint ports of the stream. + * + * @param destinationEndpointPorts the destinationEndpointPorts value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withDestinationEndpointPorts(List destinationEndpointPorts) { + this.destinationEndpointPorts = destinationEndpointPorts; + return this; + } + + /** + * Get the eventHubId property: Event Hub ID. + * + * @return the eventHubId value. + */ + public String eventHubId() { + return this.eventHubId; + } + + /** + * Set the eventHubId property: Event Hub ID. + * + * @param eventHubId the eventHubId value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withEventHubId(String eventHubId) { + this.eventHubId = eventHubId; + return this; + } + + /** + * Get the consumerGroup property: Event Hub Consumer Group. + * + * @return the consumerGroup value. + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set the consumerGroup property: Event Hub Consumer Group. + * + * @param consumerGroup the consumerGroup value to set. + * @return the FlowPropertiesInner object itself. + */ + public FlowPropertiesInner withConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connection() != null) { + connection().validate(); + } + if (schema() != null) { + schema().validate(); + } + if (messagingOptions() != null) { + messagingOptions().validate(); + } + if (apiFlowOptions() != null) { + apiFlowOptions().validate(); + } + if (sourceAddresses() != null) { + sourceAddresses().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("connection", this.connection); + jsonWriter.writeStringField("keyVaultUri", this.keyVaultUri); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("storageAccountName", this.storageAccountName); + jsonWriter.writeStringField("storageAccountId", this.storageAccountId); + jsonWriter.writeStringField("storageContainerName", this.storageContainerName); + jsonWriter.writeStringField("storageTableName", this.storageTableName); + jsonWriter.writeStringField("serviceBusQueueId", this.serviceBusQueueId); + jsonWriter.writeStringField("flowType", this.flowType == null ? null : this.flowType.toString()); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + jsonWriter.writeArrayField("policies", this.policies, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("schema", this.schema); + jsonWriter.writeJsonField("messagingOptions", this.messagingOptions); + jsonWriter.writeJsonField("apiFlowOptions", this.apiFlowOptions); + jsonWriter.writeStringField("customerManagedKeyVaultUri", this.customerManagedKeyVaultUri); + jsonWriter.writeStringField("streamId", this.streamId); + jsonWriter.writeStringField("streamProtocol", + this.streamProtocol == null ? null : this.streamProtocol.toString()); + jsonWriter.writeNumberField("streamLatency", this.streamLatency); + jsonWriter.writeStringField("passphrase", this.passphrase); + jsonWriter.writeJsonField("sourceAddresses", this.sourceAddresses); + jsonWriter.writeArrayField("destinationEndpoints", this.destinationEndpoints, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationEndpointPorts", this.destinationEndpointPorts, + (writer, element) -> writer.writeLong(element)); + jsonWriter.writeStringField("eventHubId", this.eventHubId); + jsonWriter.writeStringField("consumerGroup", this.consumerGroup); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowPropertiesInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FlowPropertiesInner. + */ + public static FlowPropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowPropertiesInner deserializedFlowPropertiesInner = new FlowPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connection".equals(fieldName)) { + deserializedFlowPropertiesInner.connection = SelectedResource.fromJson(reader); + } else if ("flowId".equals(fieldName)) { + deserializedFlowPropertiesInner.flowId = reader.getString(); + } else if ("keyVaultUri".equals(fieldName)) { + deserializedFlowPropertiesInner.keyVaultUri = reader.getString(); + } else if ("linkStatus".equals(fieldName)) { + deserializedFlowPropertiesInner.linkStatus = LinkStatus.fromString(reader.getString()); + } else if ("linkedFlowId".equals(fieldName)) { + deserializedFlowPropertiesInner.linkedFlowId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedFlowPropertiesInner.status = FlowStatus.fromString(reader.getString()); + } else if ("forceDisabledStatus".equals(fieldName)) { + List forceDisabledStatus + = reader.readArray(reader1 -> ForceDisabledStatus.fromString(reader1.getString())); + deserializedFlowPropertiesInner.forceDisabledStatus = forceDisabledStatus; + } else if ("storageAccountName".equals(fieldName)) { + deserializedFlowPropertiesInner.storageAccountName = reader.getString(); + } else if ("storageAccountId".equals(fieldName)) { + deserializedFlowPropertiesInner.storageAccountId = reader.getString(); + } else if ("storageContainerName".equals(fieldName)) { + deserializedFlowPropertiesInner.storageContainerName = reader.getString(); + } else if ("storageTableName".equals(fieldName)) { + deserializedFlowPropertiesInner.storageTableName = reader.getString(); + } else if ("serviceBusQueueId".equals(fieldName)) { + deserializedFlowPropertiesInner.serviceBusQueueId = reader.getString(); + } else if ("flowType".equals(fieldName)) { + deserializedFlowPropertiesInner.flowType = FlowType.fromString(reader.getString()); + } else if ("dataType".equals(fieldName)) { + deserializedFlowPropertiesInner.dataType = DataType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedFlowPropertiesInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("policies".equals(fieldName)) { + List policies = reader.readArray(reader1 -> reader1.getString()); + deserializedFlowPropertiesInner.policies = policies; + } else if ("schema".equals(fieldName)) { + deserializedFlowPropertiesInner.schema = Schema.fromJson(reader); + } else if ("messagingOptions".equals(fieldName)) { + deserializedFlowPropertiesInner.messagingOptions = MessagingOptions.fromJson(reader); + } else if ("apiFlowOptions".equals(fieldName)) { + deserializedFlowPropertiesInner.apiFlowOptions = ApiFlowOptions.fromJson(reader); + } else if ("customerManagedKeyVaultUri".equals(fieldName)) { + deserializedFlowPropertiesInner.customerManagedKeyVaultUri = reader.getString(); + } else if ("streamId".equals(fieldName)) { + deserializedFlowPropertiesInner.streamId = reader.getString(); + } else if ("streamProtocol".equals(fieldName)) { + deserializedFlowPropertiesInner.streamProtocol = StreamProtocol.fromString(reader.getString()); + } else if ("streamLatency".equals(fieldName)) { + deserializedFlowPropertiesInner.streamLatency = reader.getNullable(JsonReader::getLong); + } else if ("passphrase".equals(fieldName)) { + deserializedFlowPropertiesInner.passphrase = reader.getString(); + } else if ("sourceAddresses".equals(fieldName)) { + deserializedFlowPropertiesInner.sourceAddresses = StreamSourceAddressesInner.fromJson(reader); + } else if ("destinationEndpoints".equals(fieldName)) { + List destinationEndpoints = reader.readArray(reader1 -> reader1.getString()); + deserializedFlowPropertiesInner.destinationEndpoints = destinationEndpoints; + } else if ("destinationEndpointPorts".equals(fieldName)) { + List destinationEndpointPorts = reader.readArray(reader1 -> reader1.getLong()); + deserializedFlowPropertiesInner.destinationEndpointPorts = destinationEndpointPorts; + } else if ("eventHubId".equals(fieldName)) { + deserializedFlowPropertiesInner.eventHubId = reader.getString(); + } else if ("consumerGroup".equals(fieldName)) { + deserializedFlowPropertiesInner.consumerGroup = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowPropertiesInner; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/GetDestinationEndpointPortsResultInner.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/GetDestinationEndpointPortsResultInner.java new file mode 100644 index 000000000000..8861e1d9b703 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/GetDestinationEndpointPortsResultInner.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of destination endpoint ports for the flow stream. + */ +@Fluent +public final class GetDestinationEndpointPortsResultInner + implements JsonSerializable { + /* + * The destination endpoint port for the flow stream + */ + private List ports; + + /** + * Creates an instance of GetDestinationEndpointPortsResultInner class. + */ + public GetDestinationEndpointPortsResultInner() { + } + + /** + * Get the ports property: The destination endpoint port for the flow stream. + * + * @return the ports value. + */ + public List ports() { + return this.ports; + } + + /** + * Set the ports property: The destination endpoint port for the flow stream. + * + * @param ports the ports value to set. + * @return the GetDestinationEndpointPortsResultInner object itself. + */ + public GetDestinationEndpointPortsResultInner withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ports", this.ports, (writer, element) -> writer.writeLong(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetDestinationEndpointPortsResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetDestinationEndpointPortsResultInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GetDestinationEndpointPortsResultInner. + */ + public static GetDestinationEndpointPortsResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetDestinationEndpointPortsResultInner deserializedGetDestinationEndpointPortsResultInner + = new GetDestinationEndpointPortsResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ports".equals(fieldName)) { + List ports = reader.readArray(reader1 -> reader1.getLong()); + deserializedGetDestinationEndpointPortsResultInner.ports = ports; + } else { + reader.skipChildren(); + } + } + + return deserializedGetDestinationEndpointPortsResultInner; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/GetDestinationEndpointsResultInner.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/GetDestinationEndpointsResultInner.java new file mode 100644 index 000000000000..7fb64f441174 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/GetDestinationEndpointsResultInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of destination endpoints for the flow stream. + */ +@Fluent +public final class GetDestinationEndpointsResultInner implements JsonSerializable { + /* + * The destination endpoints for the flow stream + */ + private List endpoints; + + /** + * Creates an instance of GetDestinationEndpointsResultInner class. + */ + public GetDestinationEndpointsResultInner() { + } + + /** + * Get the endpoints property: The destination endpoints for the flow stream. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: The destination endpoints for the flow stream. + * + * @param endpoints the endpoints value to set. + * @return the GetDestinationEndpointsResultInner object itself. + */ + public GetDestinationEndpointsResultInner withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("endpoints", this.endpoints, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetDestinationEndpointsResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetDestinationEndpointsResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GetDestinationEndpointsResultInner. + */ + public static GetDestinationEndpointsResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetDestinationEndpointsResultInner deserializedGetDestinationEndpointsResultInner + = new GetDestinationEndpointsResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpoints".equals(fieldName)) { + List endpoints = reader.readArray(reader1 -> reader1.getString()); + deserializedGetDestinationEndpointsResultInner.endpoints = endpoints; + } else { + reader.skipChildren(); + } + } + + return deserializedGetDestinationEndpointsResultInner; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/GetStreamConnectionStringResultInner.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/GetStreamConnectionStringResultInner.java new file mode 100644 index 000000000000..78476081e3c3 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/GetStreamConnectionStringResultInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The connection string for the specified streaming flow. + */ +@Fluent +public final class GetStreamConnectionStringResultInner + implements JsonSerializable { + /* + * The connection string for the specified streaming flow + */ + private String connectionString; + + /** + * Creates an instance of GetStreamConnectionStringResultInner class. + */ + public GetStreamConnectionStringResultInner() { + } + + /** + * Get the connectionString property: The connection string for the specified streaming flow. + * + * @return the connectionString value. + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set the connectionString property: The connection string for the specified streaming flow. + * + * @param connectionString the connectionString value to set. + * @return the GetStreamConnectionStringResultInner object itself. + */ + public GetStreamConnectionStringResultInner withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("connectionString", this.connectionString); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetStreamConnectionStringResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetStreamConnectionStringResultInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GetStreamConnectionStringResultInner. + */ + public static GetStreamConnectionStringResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetStreamConnectionStringResultInner deserializedGetStreamConnectionStringResultInner + = new GetStreamConnectionStringResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectionString".equals(fieldName)) { + deserializedGetStreamConnectionStringResultInner.connectionString = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGetStreamConnectionStringResultInner; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/ListFlowsByPipelineResultInner.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/ListFlowsByPipelineResultInner.java new file mode 100644 index 000000000000..13a0edc15a48 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/ListFlowsByPipelineResultInner.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.models.ListFlowsByPipelineConnection; +import java.io.IOException; +import java.util.List; + +/** + * An array of flow resources. + */ +@Fluent +public final class ListFlowsByPipelineResultInner implements JsonSerializable { + /* + * List flows by pipeline result by connection + */ + private List value; + + /** + * Creates an instance of ListFlowsByPipelineResultInner class. + */ + public ListFlowsByPipelineResultInner() { + } + + /** + * Get the value property: List flows by pipeline result by connection. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List flows by pipeline result by connection. + * + * @param value the value value to set. + * @return the ListFlowsByPipelineResultInner object itself. + */ + public ListFlowsByPipelineResultInner 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListFlowsByPipelineResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListFlowsByPipelineResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListFlowsByPipelineResultInner. + */ + public static ListFlowsByPipelineResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListFlowsByPipelineResultInner deserializedListFlowsByPipelineResultInner + = new ListFlowsByPipelineResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ListFlowsByPipelineConnection.fromJson(reader1)); + deserializedListFlowsByPipelineResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedListFlowsByPipelineResultInner; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/OperationInner.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/OperationInner.java new file mode 100644 index 000000000000..5bd52d73a3d0 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/OperationInner.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.models.ActionType; +import com.azure.resourcemanager.azuredatatransfer.models.OperationDisplay; +import com.azure.resourcemanager.azuredatatransfer.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/PendingConnectionInner.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/PendingConnectionInner.java new file mode 100644 index 000000000000..da550adf907f --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/PendingConnectionInner.java @@ -0,0 +1,741 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.models.ConnectionStatus; +import com.azure.resourcemanager.azuredatatransfer.models.Direction; +import com.azure.resourcemanager.azuredatatransfer.models.FlowType; +import com.azure.resourcemanager.azuredatatransfer.models.ForceDisabledStatus; +import com.azure.resourcemanager.azuredatatransfer.models.LinkStatus; +import com.azure.resourcemanager.azuredatatransfer.models.ProvisioningState; +import com.azure.resourcemanager.azuredatatransfer.models.Schema; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * Pending connection object. + */ +@Fluent +public final class PendingConnectionInner implements JsonSerializable { + /* + * Pipeline to use to transfer data + */ + private String pipeline; + + /* + * Direction of data movement + */ + private Direction direction; + + /* + * Justification for the connection request + */ + private String justification; + + /* + * Status of the connection + */ + private ConnectionStatus status; + + /* + * Force disablement status of the current connection + */ + private List forceDisabledStatus; + + /* + * Reason for status + */ + private String statusReason; + + /* + * Link status of the current connection + */ + private LinkStatus linkStatus; + + /* + * Resource ID of the linked connection + */ + private String linkedConnectionId; + + /* + * The flow types being requested for this connection + */ + private List flowTypes; + + /* + * Requirement ID of the connection + */ + private String requirementId; + + /* + * Subscription ID to link cloud subscriptions together + */ + private String remoteSubscriptionId; + + /* + * Approver of this connection request + */ + private String approver; + + /* + * PIN to link requests together + */ + private String pin; + + /* + * The timestamp that this connection request was submitted at + */ + private OffsetDateTime dateSubmitted; + + /* + * The primary contact for this connection request + */ + private String primaryContact; + + /* + * The secondary contacts for this connection request + */ + private List secondaryContacts; + + /* + * Provisioning state of the connection + */ + private ProvisioningState provisioningState; + + /* + * The policies for this connection + */ + private List policies; + + /* + * The schemas for this connection + */ + private List schemas; + + /* + * The schema URIs for this connection + */ + private List schemaUris; + + /* + * The resource-specific properties for this resource. + */ + private ConnectionInner properties; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{ + * resourceType}/{resourceName} + */ + private String id; + + /* + * The name of the resource + */ + private String name; + + /* + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + */ + private String type; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Subscription ID of the pending connection. + */ + private String subscriptionId; + + /** + * Creates an instance of PendingConnectionInner class. + */ + public PendingConnectionInner() { + } + + /** + * Get the pipeline property: Pipeline to use to transfer data. + * + * @return the pipeline value. + */ + public String pipeline() { + return this.pipeline; + } + + /** + * Set the pipeline property: Pipeline to use to transfer data. + * + * @param pipeline the pipeline value to set. + * @return the PendingConnectionInner object itself. + */ + public PendingConnectionInner withPipeline(String pipeline) { + this.pipeline = pipeline; + return this; + } + + /** + * Get the direction property: Direction of data movement. + * + * @return the direction value. + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction property: Direction of data movement. + * + * @param direction the direction value to set. + * @return the PendingConnectionInner object itself. + */ + public PendingConnectionInner withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get the justification property: Justification for the connection request. + * + * @return the justification value. + */ + public String justification() { + return this.justification; + } + + /** + * Set the justification property: Justification for the connection request. + * + * @param justification the justification value to set. + * @return the PendingConnectionInner object itself. + */ + public PendingConnectionInner withJustification(String justification) { + this.justification = justification; + return this; + } + + /** + * Get the status property: Status of the connection. + * + * @return the status value. + */ + public ConnectionStatus status() { + return this.status; + } + + /** + * Get the forceDisabledStatus property: Force disablement status of the current connection. + * + * @return the forceDisabledStatus value. + */ + public List forceDisabledStatus() { + return this.forceDisabledStatus; + } + + /** + * Get the statusReason property: Reason for status. + * + * @return the statusReason value. + */ + public String statusReason() { + return this.statusReason; + } + + /** + * Get the linkStatus property: Link status of the current connection. + * + * @return the linkStatus value. + */ + public LinkStatus linkStatus() { + return this.linkStatus; + } + + /** + * Get the linkedConnectionId property: Resource ID of the linked connection. + * + * @return the linkedConnectionId value. + */ + public String linkedConnectionId() { + return this.linkedConnectionId; + } + + /** + * Get the flowTypes property: The flow types being requested for this connection. + * + * @return the flowTypes value. + */ + public List flowTypes() { + return this.flowTypes; + } + + /** + * Set the flowTypes property: The flow types being requested for this connection. + * + * @param flowTypes the flowTypes value to set. + * @return the PendingConnectionInner object itself. + */ + public PendingConnectionInner withFlowTypes(List flowTypes) { + this.flowTypes = flowTypes; + return this; + } + + /** + * Get the requirementId property: Requirement ID of the connection. + * + * @return the requirementId value. + */ + public String requirementId() { + return this.requirementId; + } + + /** + * Set the requirementId property: Requirement ID of the connection. + * + * @param requirementId the requirementId value to set. + * @return the PendingConnectionInner object itself. + */ + public PendingConnectionInner withRequirementId(String requirementId) { + this.requirementId = requirementId; + return this; + } + + /** + * Get the remoteSubscriptionId property: Subscription ID to link cloud subscriptions together. + * + * @return the remoteSubscriptionId value. + */ + public String remoteSubscriptionId() { + return this.remoteSubscriptionId; + } + + /** + * Set the remoteSubscriptionId property: Subscription ID to link cloud subscriptions together. + * + * @param remoteSubscriptionId the remoteSubscriptionId value to set. + * @return the PendingConnectionInner object itself. + */ + public PendingConnectionInner withRemoteSubscriptionId(String remoteSubscriptionId) { + this.remoteSubscriptionId = remoteSubscriptionId; + return this; + } + + /** + * Get the approver property: Approver of this connection request. + * + * @return the approver value. + */ + public String approver() { + return this.approver; + } + + /** + * Get the pin property: PIN to link requests together. + * + * @return the pin value. + */ + public String pin() { + return this.pin; + } + + /** + * Set the pin property: PIN to link requests together. + * + * @param pin the pin value to set. + * @return the PendingConnectionInner object itself. + */ + public PendingConnectionInner withPin(String pin) { + this.pin = pin; + return this; + } + + /** + * Get the dateSubmitted property: The timestamp that this connection request was submitted at. + * + * @return the dateSubmitted value. + */ + public OffsetDateTime dateSubmitted() { + return this.dateSubmitted; + } + + /** + * Get the primaryContact property: The primary contact for this connection request. + * + * @return the primaryContact value. + */ + public String primaryContact() { + return this.primaryContact; + } + + /** + * Set the primaryContact property: The primary contact for this connection request. + * + * @param primaryContact the primaryContact value to set. + * @return the PendingConnectionInner object itself. + */ + public PendingConnectionInner withPrimaryContact(String primaryContact) { + this.primaryContact = primaryContact; + return this; + } + + /** + * Get the secondaryContacts property: The secondary contacts for this connection request. + * + * @return the secondaryContacts value. + */ + public List secondaryContacts() { + return this.secondaryContacts; + } + + /** + * Set the secondaryContacts property: The secondary contacts for this connection request. + * + * @param secondaryContacts the secondaryContacts value to set. + * @return the PendingConnectionInner object itself. + */ + public PendingConnectionInner withSecondaryContacts(List secondaryContacts) { + this.secondaryContacts = secondaryContacts; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the connection. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the policies property: The policies for this connection. + * + * @return the policies value. + */ + public List policies() { + return this.policies; + } + + /** + * Set the policies property: The policies for this connection. + * + * @param policies the policies value to set. + * @return the PendingConnectionInner object itself. + */ + public PendingConnectionInner withPolicies(List policies) { + this.policies = policies; + return this; + } + + /** + * Get the schemas property: The schemas for this connection. + * + * @return the schemas value. + */ + public List schemas() { + return this.schemas; + } + + /** + * Set the schemas property: The schemas for this connection. + * + * @param schemas the schemas value to set. + * @return the PendingConnectionInner object itself. + */ + public PendingConnectionInner withSchemas(List schemas) { + this.schemas = schemas; + return this; + } + + /** + * Get the schemaUris property: The schema URIs for this connection. + * + * @return the schemaUris value. + */ + public List schemaUris() { + return this.schemaUris; + } + + /** + * Set the schemaUris property: The schema URIs for this connection. + * + * @param schemaUris the schemaUris value to set. + * @return the PendingConnectionInner object itself. + */ + public PendingConnectionInner withSchemaUris(List schemaUris) { + this.schemaUris = schemaUris; + return this; + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ConnectionInner properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the PendingConnectionInner object itself. + */ + public PendingConnectionInner withProperties(ConnectionInner properties) { + this.properties = properties; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the PendingConnectionInner object itself. + */ + public PendingConnectionInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the PendingConnectionInner object itself. + */ + public PendingConnectionInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * 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 subscriptionId property: Subscription ID of the pending connection. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (pipeline() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property pipeline in model PendingConnectionInner")); + } + if (schemas() != null) { + schemas().forEach(e -> e.validate()); + } + if (properties() != null) { + properties().validate(); + } + if (location() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property location in model PendingConnectionInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PendingConnectionInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pipeline", this.pipeline); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + jsonWriter.writeStringField("justification", this.justification); + jsonWriter.writeArrayField("flowTypes", this.flowTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("requirementId", this.requirementId); + jsonWriter.writeStringField("remoteSubscriptionId", this.remoteSubscriptionId); + jsonWriter.writeStringField("pin", this.pin); + jsonWriter.writeStringField("primaryContact", this.primaryContact); + jsonWriter.writeArrayField("secondaryContacts", this.secondaryContacts, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("policies", this.policies, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("schemas", this.schemas, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("schemaUris", this.schemaUris, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PendingConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PendingConnectionInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PendingConnectionInner. + */ + public static PendingConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PendingConnectionInner deserializedPendingConnectionInner = new PendingConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pipeline".equals(fieldName)) { + deserializedPendingConnectionInner.pipeline = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPendingConnectionInner.location = reader.getString(); + } else if ("direction".equals(fieldName)) { + deserializedPendingConnectionInner.direction = Direction.fromString(reader.getString()); + } else if ("justification".equals(fieldName)) { + deserializedPendingConnectionInner.justification = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedPendingConnectionInner.status = ConnectionStatus.fromString(reader.getString()); + } else if ("forceDisabledStatus".equals(fieldName)) { + List forceDisabledStatus + = reader.readArray(reader1 -> ForceDisabledStatus.fromString(reader1.getString())); + deserializedPendingConnectionInner.forceDisabledStatus = forceDisabledStatus; + } else if ("statusReason".equals(fieldName)) { + deserializedPendingConnectionInner.statusReason = reader.getString(); + } else if ("linkStatus".equals(fieldName)) { + deserializedPendingConnectionInner.linkStatus = LinkStatus.fromString(reader.getString()); + } else if ("linkedConnectionId".equals(fieldName)) { + deserializedPendingConnectionInner.linkedConnectionId = reader.getString(); + } else if ("flowTypes".equals(fieldName)) { + List flowTypes = reader.readArray(reader1 -> FlowType.fromString(reader1.getString())); + deserializedPendingConnectionInner.flowTypes = flowTypes; + } else if ("requirementId".equals(fieldName)) { + deserializedPendingConnectionInner.requirementId = reader.getString(); + } else if ("remoteSubscriptionId".equals(fieldName)) { + deserializedPendingConnectionInner.remoteSubscriptionId = reader.getString(); + } else if ("approver".equals(fieldName)) { + deserializedPendingConnectionInner.approver = reader.getString(); + } else if ("pin".equals(fieldName)) { + deserializedPendingConnectionInner.pin = reader.getString(); + } else if ("dateSubmitted".equals(fieldName)) { + deserializedPendingConnectionInner.dateSubmitted = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("primaryContact".equals(fieldName)) { + deserializedPendingConnectionInner.primaryContact = reader.getString(); + } else if ("secondaryContacts".equals(fieldName)) { + List secondaryContacts = reader.readArray(reader1 -> reader1.getString()); + deserializedPendingConnectionInner.secondaryContacts = secondaryContacts; + } else if ("provisioningState".equals(fieldName)) { + deserializedPendingConnectionInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("policies".equals(fieldName)) { + List policies = reader.readArray(reader1 -> reader1.getString()); + deserializedPendingConnectionInner.policies = policies; + } else if ("schemas".equals(fieldName)) { + List schemas = reader.readArray(reader1 -> Schema.fromJson(reader1)); + deserializedPendingConnectionInner.schemas = schemas; + } else if ("schemaUris".equals(fieldName)) { + List schemaUris = reader.readArray(reader1 -> reader1.getString()); + deserializedPendingConnectionInner.schemaUris = schemaUris; + } else if ("properties".equals(fieldName)) { + deserializedPendingConnectionInner.properties = ConnectionInner.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPendingConnectionInner.tags = tags; + } else if ("id".equals(fieldName)) { + deserializedPendingConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPendingConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPendingConnectionInner.type = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedPendingConnectionInner.systemData = SystemData.fromJson(reader); + } else if ("subscriptionId".equals(fieldName)) { + deserializedPendingConnectionInner.subscriptionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPendingConnectionInner; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/PendingFlowInner.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/PendingFlowInner.java new file mode 100644 index 000000000000..f36028fa97a3 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/PendingFlowInner.java @@ -0,0 +1,1050 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.models.ApiFlowOptions; +import com.azure.resourcemanager.azuredatatransfer.models.DataType; +import com.azure.resourcemanager.azuredatatransfer.models.FlowStatus; +import com.azure.resourcemanager.azuredatatransfer.models.FlowType; +import com.azure.resourcemanager.azuredatatransfer.models.ForceDisabledStatus; +import com.azure.resourcemanager.azuredatatransfer.models.LinkStatus; +import com.azure.resourcemanager.azuredatatransfer.models.MessagingOptions; +import com.azure.resourcemanager.azuredatatransfer.models.ProvisioningState; +import com.azure.resourcemanager.azuredatatransfer.models.Schema; +import com.azure.resourcemanager.azuredatatransfer.models.SelectedResource; +import com.azure.resourcemanager.azuredatatransfer.models.StreamProtocol; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Pending flow object. + */ +@Fluent +public final class PendingFlowInner implements JsonSerializable { + /* + * The connection associated with this flow + */ + private SelectedResource connection; + + /* + * Dataflow GUID associated with this flow + */ + private String flowId; + + /* + * AME, PME, or TORUS only! AKV Chain Containing SAS Token + */ + private String keyVaultUri; + + /* + * Link status of the current flow + */ + private LinkStatus linkStatus; + + /* + * Resource ID of the linked flow + */ + private String linkedFlowId; + + /* + * Status of the current flow + */ + private FlowStatus status; + + /* + * Force disablement status of the current flow + */ + private List forceDisabledStatus; + + /* + * Storage Account + */ + private String storageAccountName; + + /* + * Storage Account ID + */ + private String storageAccountId; + + /* + * Storage Container Name + */ + private String storageContainerName; + + /* + * Storage Table Name + */ + private String storageTableName; + + /* + * Service Bus Queue ID + */ + private String serviceBusQueueId; + + /* + * The flow type for this flow + */ + private FlowType flowType; + + /* + * Transfer Storage Blobs or Tables + */ + private DataType dataType; + + /* + * Provisioning state of the flow + */ + private ProvisioningState provisioningState; + + /* + * The policies for this flow + */ + private List policies; + + /* + * The selected schema for this flow + */ + private Schema schema; + + /* + * The messaging options for this flow + */ + private MessagingOptions messagingOptions; + + /* + * The API Flow configuration options for Azure Data Transfer API Flow type. + */ + private ApiFlowOptions apiFlowOptions; + + /* + * The URI to the customer managed key for this flow + */ + private String customerManagedKeyVaultUri; + + /* + * The flow stream identifier + */ + private String streamId; + + /* + * The protocol of the stream + */ + private StreamProtocol streamProtocol; + + /* + * The latency of the stream in milliseconds + */ + private Long streamLatency; + + /* + * The passphrase used for SRT streams + */ + private String passphrase; + + /* + * The source IP address and CIDR ranges of the stream + */ + private StreamSourceAddressesInner sourceAddresses; + + /* + * The destination endpoints of the stream + */ + private List destinationEndpoints; + + /* + * The destination endpoint ports of the stream + */ + private List destinationEndpointPorts; + + /* + * Event Hub ID + */ + private String eventHubId; + + /* + * Event Hub Consumer Group + */ + private String consumerGroup; + + /* + * The resource-specific properties for this resource. + */ + private FlowInner properties; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{ + * resourceType}/{resourceName} + */ + private String id; + + /* + * The name of the resource + */ + private String name; + + /* + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + */ + private String type; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * Subscription ID of the pending flow. + */ + private String subscriptionId; + + /* + * Connection ID of the pending flow. + */ + private String connectionId; + + /** + * Creates an instance of PendingFlowInner class. + */ + public PendingFlowInner() { + } + + /** + * Get the connection property: The connection associated with this flow. + * + * @return the connection value. + */ + public SelectedResource connection() { + return this.connection; + } + + /** + * Set the connection property: The connection associated with this flow. + * + * @param connection the connection value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withConnection(SelectedResource connection) { + this.connection = connection; + return this; + } + + /** + * Get the flowId property: Dataflow GUID associated with this flow. + * + * @return the flowId value. + */ + public String flowId() { + return this.flowId; + } + + /** + * Get the keyVaultUri property: AME, PME, or TORUS only! AKV Chain Containing SAS Token. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: AME, PME, or TORUS only! AKV Chain Containing SAS Token. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the linkStatus property: Link status of the current flow. + * + * @return the linkStatus value. + */ + public LinkStatus linkStatus() { + return this.linkStatus; + } + + /** + * Get the linkedFlowId property: Resource ID of the linked flow. + * + * @return the linkedFlowId value. + */ + public String linkedFlowId() { + return this.linkedFlowId; + } + + /** + * Get the status property: Status of the current flow. + * + * @return the status value. + */ + public FlowStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the current flow. + * + * @param status the status value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withStatus(FlowStatus status) { + this.status = status; + return this; + } + + /** + * Get the forceDisabledStatus property: Force disablement status of the current flow. + * + * @return the forceDisabledStatus value. + */ + public List forceDisabledStatus() { + return this.forceDisabledStatus; + } + + /** + * Get the storageAccountName property: Storage Account. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the storageAccountName property: Storage Account. + * + * @param storageAccountName the storageAccountName value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storageAccountId property: Storage Account ID. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: Storage Account ID. + * + * @param storageAccountId the storageAccountId value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Get the storageContainerName property: Storage Container Name. + * + * @return the storageContainerName value. + */ + public String storageContainerName() { + return this.storageContainerName; + } + + /** + * Set the storageContainerName property: Storage Container Name. + * + * @param storageContainerName the storageContainerName value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withStorageContainerName(String storageContainerName) { + this.storageContainerName = storageContainerName; + return this; + } + + /** + * Get the storageTableName property: Storage Table Name. + * + * @return the storageTableName value. + */ + public String storageTableName() { + return this.storageTableName; + } + + /** + * Set the storageTableName property: Storage Table Name. + * + * @param storageTableName the storageTableName value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withStorageTableName(String storageTableName) { + this.storageTableName = storageTableName; + return this; + } + + /** + * Get the serviceBusQueueId property: Service Bus Queue ID. + * + * @return the serviceBusQueueId value. + */ + public String serviceBusQueueId() { + return this.serviceBusQueueId; + } + + /** + * Set the serviceBusQueueId property: Service Bus Queue ID. + * + * @param serviceBusQueueId the serviceBusQueueId value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withServiceBusQueueId(String serviceBusQueueId) { + this.serviceBusQueueId = serviceBusQueueId; + return this; + } + + /** + * Get the flowType property: The flow type for this flow. + * + * @return the flowType value. + */ + public FlowType flowType() { + return this.flowType; + } + + /** + * Set the flowType property: The flow type for this flow. + * + * @param flowType the flowType value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withFlowType(FlowType flowType) { + this.flowType = flowType; + return this; + } + + /** + * Get the dataType property: Transfer Storage Blobs or Tables. + * + * @return the dataType value. + */ + public DataType dataType() { + return this.dataType; + } + + /** + * Set the dataType property: Transfer Storage Blobs or Tables. + * + * @param dataType the dataType value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withDataType(DataType dataType) { + this.dataType = dataType; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the flow. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the policies property: The policies for this flow. + * + * @return the policies value. + */ + public List policies() { + return this.policies; + } + + /** + * Set the policies property: The policies for this flow. + * + * @param policies the policies value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withPolicies(List policies) { + this.policies = policies; + return this; + } + + /** + * Get the schema property: The selected schema for this flow. + * + * @return the schema value. + */ + public Schema schema() { + return this.schema; + } + + /** + * Set the schema property: The selected schema for this flow. + * + * @param schema the schema value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withSchema(Schema schema) { + this.schema = schema; + return this; + } + + /** + * Get the messagingOptions property: The messaging options for this flow. + * + * @return the messagingOptions value. + */ + public MessagingOptions messagingOptions() { + return this.messagingOptions; + } + + /** + * Set the messagingOptions property: The messaging options for this flow. + * + * @param messagingOptions the messagingOptions value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withMessagingOptions(MessagingOptions messagingOptions) { + this.messagingOptions = messagingOptions; + return this; + } + + /** + * Get the apiFlowOptions property: The API Flow configuration options for Azure Data Transfer API Flow type. + * + * @return the apiFlowOptions value. + */ + public ApiFlowOptions apiFlowOptions() { + return this.apiFlowOptions; + } + + /** + * Set the apiFlowOptions property: The API Flow configuration options for Azure Data Transfer API Flow type. + * + * @param apiFlowOptions the apiFlowOptions value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withApiFlowOptions(ApiFlowOptions apiFlowOptions) { + this.apiFlowOptions = apiFlowOptions; + return this; + } + + /** + * Get the customerManagedKeyVaultUri property: The URI to the customer managed key for this flow. + * + * @return the customerManagedKeyVaultUri value. + */ + public String customerManagedKeyVaultUri() { + return this.customerManagedKeyVaultUri; + } + + /** + * Set the customerManagedKeyVaultUri property: The URI to the customer managed key for this flow. + * + * @param customerManagedKeyVaultUri the customerManagedKeyVaultUri value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withCustomerManagedKeyVaultUri(String customerManagedKeyVaultUri) { + this.customerManagedKeyVaultUri = customerManagedKeyVaultUri; + return this; + } + + /** + * Get the streamId property: The flow stream identifier. + * + * @return the streamId value. + */ + public String streamId() { + return this.streamId; + } + + /** + * Set the streamId property: The flow stream identifier. + * + * @param streamId the streamId value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withStreamId(String streamId) { + this.streamId = streamId; + return this; + } + + /** + * Get the streamProtocol property: The protocol of the stream. + * + * @return the streamProtocol value. + */ + public StreamProtocol streamProtocol() { + return this.streamProtocol; + } + + /** + * Set the streamProtocol property: The protocol of the stream. + * + * @param streamProtocol the streamProtocol value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withStreamProtocol(StreamProtocol streamProtocol) { + this.streamProtocol = streamProtocol; + return this; + } + + /** + * Get the streamLatency property: The latency of the stream in milliseconds. + * + * @return the streamLatency value. + */ + public Long streamLatency() { + return this.streamLatency; + } + + /** + * Set the streamLatency property: The latency of the stream in milliseconds. + * + * @param streamLatency the streamLatency value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withStreamLatency(Long streamLatency) { + this.streamLatency = streamLatency; + return this; + } + + /** + * Get the passphrase property: The passphrase used for SRT streams. + * + * @return the passphrase value. + */ + public String passphrase() { + return this.passphrase; + } + + /** + * Set the passphrase property: The passphrase used for SRT streams. + * + * @param passphrase the passphrase value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withPassphrase(String passphrase) { + this.passphrase = passphrase; + return this; + } + + /** + * Get the sourceAddresses property: The source IP address and CIDR ranges of the stream. + * + * @return the sourceAddresses value. + */ + public StreamSourceAddressesInner sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: The source IP address and CIDR ranges of the stream. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withSourceAddresses(StreamSourceAddressesInner sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Get the destinationEndpoints property: The destination endpoints of the stream. + * + * @return the destinationEndpoints value. + */ + public List destinationEndpoints() { + return this.destinationEndpoints; + } + + /** + * Set the destinationEndpoints property: The destination endpoints of the stream. + * + * @param destinationEndpoints the destinationEndpoints value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withDestinationEndpoints(List destinationEndpoints) { + this.destinationEndpoints = destinationEndpoints; + return this; + } + + /** + * Get the destinationEndpointPorts property: The destination endpoint ports of the stream. + * + * @return the destinationEndpointPorts value. + */ + public List destinationEndpointPorts() { + return this.destinationEndpointPorts; + } + + /** + * Set the destinationEndpointPorts property: The destination endpoint ports of the stream. + * + * @param destinationEndpointPorts the destinationEndpointPorts value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withDestinationEndpointPorts(List destinationEndpointPorts) { + this.destinationEndpointPorts = destinationEndpointPorts; + return this; + } + + /** + * Get the eventHubId property: Event Hub ID. + * + * @return the eventHubId value. + */ + public String eventHubId() { + return this.eventHubId; + } + + /** + * Set the eventHubId property: Event Hub ID. + * + * @param eventHubId the eventHubId value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withEventHubId(String eventHubId) { + this.eventHubId = eventHubId; + return this; + } + + /** + * Get the consumerGroup property: Event Hub Consumer Group. + * + * @return the consumerGroup value. + */ + public String consumerGroup() { + return this.consumerGroup; + } + + /** + * Set the consumerGroup property: Event Hub Consumer Group. + * + * @param consumerGroup the consumerGroup value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withConsumerGroup(String consumerGroup) { + this.consumerGroup = consumerGroup; + return this; + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public FlowInner properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withProperties(FlowInner properties) { + this.properties = properties; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the PendingFlowInner object itself. + */ + public PendingFlowInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * 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 subscriptionId property: Subscription ID of the pending flow. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the connectionId property: Connection ID of the pending flow. + * + * @return the connectionId value. + */ + public String connectionId() { + return this.connectionId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connection() != null) { + connection().validate(); + } + if (schema() != null) { + schema().validate(); + } + if (messagingOptions() != null) { + messagingOptions().validate(); + } + if (apiFlowOptions() != null) { + apiFlowOptions().validate(); + } + if (sourceAddresses() != null) { + sourceAddresses().validate(); + } + if (properties() != null) { + properties().validate(); + } + if (location() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property location in model PendingFlowInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PendingFlowInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("connection", this.connection); + jsonWriter.writeStringField("keyVaultUri", this.keyVaultUri); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("storageAccountName", this.storageAccountName); + jsonWriter.writeStringField("storageAccountId", this.storageAccountId); + jsonWriter.writeStringField("storageContainerName", this.storageContainerName); + jsonWriter.writeStringField("storageTableName", this.storageTableName); + jsonWriter.writeStringField("serviceBusQueueId", this.serviceBusQueueId); + jsonWriter.writeStringField("flowType", this.flowType == null ? null : this.flowType.toString()); + jsonWriter.writeStringField("dataType", this.dataType == null ? null : this.dataType.toString()); + jsonWriter.writeArrayField("policies", this.policies, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("schema", this.schema); + jsonWriter.writeJsonField("messagingOptions", this.messagingOptions); + jsonWriter.writeJsonField("apiFlowOptions", this.apiFlowOptions); + jsonWriter.writeStringField("customerManagedKeyVaultUri", this.customerManagedKeyVaultUri); + jsonWriter.writeStringField("streamId", this.streamId); + jsonWriter.writeStringField("streamProtocol", + this.streamProtocol == null ? null : this.streamProtocol.toString()); + jsonWriter.writeNumberField("streamLatency", this.streamLatency); + jsonWriter.writeStringField("passphrase", this.passphrase); + jsonWriter.writeJsonField("sourceAddresses", this.sourceAddresses); + jsonWriter.writeArrayField("destinationEndpoints", this.destinationEndpoints, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("destinationEndpointPorts", this.destinationEndpointPorts, + (writer, element) -> writer.writeLong(element)); + jsonWriter.writeStringField("eventHubId", this.eventHubId); + jsonWriter.writeStringField("consumerGroup", this.consumerGroup); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PendingFlowInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PendingFlowInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PendingFlowInner. + */ + public static PendingFlowInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PendingFlowInner deserializedPendingFlowInner = new PendingFlowInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedPendingFlowInner.location = reader.getString(); + } else if ("connection".equals(fieldName)) { + deserializedPendingFlowInner.connection = SelectedResource.fromJson(reader); + } else if ("flowId".equals(fieldName)) { + deserializedPendingFlowInner.flowId = reader.getString(); + } else if ("keyVaultUri".equals(fieldName)) { + deserializedPendingFlowInner.keyVaultUri = reader.getString(); + } else if ("linkStatus".equals(fieldName)) { + deserializedPendingFlowInner.linkStatus = LinkStatus.fromString(reader.getString()); + } else if ("linkedFlowId".equals(fieldName)) { + deserializedPendingFlowInner.linkedFlowId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedPendingFlowInner.status = FlowStatus.fromString(reader.getString()); + } else if ("forceDisabledStatus".equals(fieldName)) { + List forceDisabledStatus + = reader.readArray(reader1 -> ForceDisabledStatus.fromString(reader1.getString())); + deserializedPendingFlowInner.forceDisabledStatus = forceDisabledStatus; + } else if ("storageAccountName".equals(fieldName)) { + deserializedPendingFlowInner.storageAccountName = reader.getString(); + } else if ("storageAccountId".equals(fieldName)) { + deserializedPendingFlowInner.storageAccountId = reader.getString(); + } else if ("storageContainerName".equals(fieldName)) { + deserializedPendingFlowInner.storageContainerName = reader.getString(); + } else if ("storageTableName".equals(fieldName)) { + deserializedPendingFlowInner.storageTableName = reader.getString(); + } else if ("serviceBusQueueId".equals(fieldName)) { + deserializedPendingFlowInner.serviceBusQueueId = reader.getString(); + } else if ("flowType".equals(fieldName)) { + deserializedPendingFlowInner.flowType = FlowType.fromString(reader.getString()); + } else if ("dataType".equals(fieldName)) { + deserializedPendingFlowInner.dataType = DataType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedPendingFlowInner.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("policies".equals(fieldName)) { + List policies = reader.readArray(reader1 -> reader1.getString()); + deserializedPendingFlowInner.policies = policies; + } else if ("schema".equals(fieldName)) { + deserializedPendingFlowInner.schema = Schema.fromJson(reader); + } else if ("messagingOptions".equals(fieldName)) { + deserializedPendingFlowInner.messagingOptions = MessagingOptions.fromJson(reader); + } else if ("apiFlowOptions".equals(fieldName)) { + deserializedPendingFlowInner.apiFlowOptions = ApiFlowOptions.fromJson(reader); + } else if ("customerManagedKeyVaultUri".equals(fieldName)) { + deserializedPendingFlowInner.customerManagedKeyVaultUri = reader.getString(); + } else if ("streamId".equals(fieldName)) { + deserializedPendingFlowInner.streamId = reader.getString(); + } else if ("streamProtocol".equals(fieldName)) { + deserializedPendingFlowInner.streamProtocol = StreamProtocol.fromString(reader.getString()); + } else if ("streamLatency".equals(fieldName)) { + deserializedPendingFlowInner.streamLatency = reader.getNullable(JsonReader::getLong); + } else if ("passphrase".equals(fieldName)) { + deserializedPendingFlowInner.passphrase = reader.getString(); + } else if ("sourceAddresses".equals(fieldName)) { + deserializedPendingFlowInner.sourceAddresses = StreamSourceAddressesInner.fromJson(reader); + } else if ("destinationEndpoints".equals(fieldName)) { + List destinationEndpoints = reader.readArray(reader1 -> reader1.getString()); + deserializedPendingFlowInner.destinationEndpoints = destinationEndpoints; + } else if ("destinationEndpointPorts".equals(fieldName)) { + List destinationEndpointPorts = reader.readArray(reader1 -> reader1.getLong()); + deserializedPendingFlowInner.destinationEndpointPorts = destinationEndpointPorts; + } else if ("eventHubId".equals(fieldName)) { + deserializedPendingFlowInner.eventHubId = reader.getString(); + } else if ("consumerGroup".equals(fieldName)) { + deserializedPendingFlowInner.consumerGroup = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPendingFlowInner.properties = FlowInner.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPendingFlowInner.tags = tags; + } else if ("id".equals(fieldName)) { + deserializedPendingFlowInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPendingFlowInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPendingFlowInner.type = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedPendingFlowInner.systemData = SystemData.fromJson(reader); + } else if ("subscriptionId".equals(fieldName)) { + deserializedPendingFlowInner.subscriptionId = reader.getString(); + } else if ("connectionId".equals(fieldName)) { + deserializedPendingFlowInner.connectionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPendingFlowInner; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/PipelineInner.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/PipelineInner.java new file mode 100644 index 000000000000..2f322714cf22 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/PipelineInner.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.azuredatatransfer.models.PipelineProperties; +import java.io.IOException; +import java.util.Map; + +/** + * The pipeline resource definition. + */ +@Fluent +public final class PipelineInner extends Resource { + /* + * Properties of pipeline + */ + private PipelineProperties properties; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PipelineInner class. + */ + public PipelineInner() { + } + + /** + * Get the properties property: Properties of pipeline. + * + * @return the properties value. + */ + public PipelineProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of pipeline. + * + * @param properties the properties value to set. + * @return the PipelineInner object itself. + */ + public PipelineInner withProperties(PipelineProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the PipelineInner object itself. + */ + public PipelineInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public PipelineInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PipelineInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PipelineInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PipelineInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PipelineInner. + */ + public static PipelineInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PipelineInner deserializedPipelineInner = new PipelineInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPipelineInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPipelineInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPipelineInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPipelineInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPipelineInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedPipelineInner.properties = PipelineProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedPipelineInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPipelineInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPipelineInner; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/SchemasListResultInner.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/SchemasListResultInner.java new file mode 100644 index 000000000000..61d95e5e482e --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/SchemasListResultInner.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.azuredatatransfer.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.models.Schema; +import java.io.IOException; +import java.util.List; + +/** + * The schemas list result. + */ +@Fluent +public final class SchemasListResultInner implements JsonSerializable { + /* + * Schemas array. + */ + private List value; + + /** + * Creates an instance of SchemasListResultInner class. + */ + public SchemasListResultInner() { + } + + /** + * Get the value property: Schemas array. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Schemas array. + * + * @param value the value value to set. + * @return the SchemasListResultInner object itself. + */ + public SchemasListResultInner 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()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SchemasListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SchemasListResultInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SchemasListResultInner. + */ + public static SchemasListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SchemasListResultInner deserializedSchemasListResultInner = new SchemasListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Schema.fromJson(reader1)); + deserializedSchemasListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedSchemasListResultInner; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/StreamSourceAddressesInner.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/StreamSourceAddressesInner.java new file mode 100644 index 000000000000..f28a5bf235bd --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/StreamSourceAddressesInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The source IP address and CIDR ranges of the stream. + */ +@Fluent +public final class StreamSourceAddressesInner implements JsonSerializable { + /* + * A source IP address or CIDR range + */ + private List sourceAddresses; + + /** + * Creates an instance of StreamSourceAddressesInner class. + */ + public StreamSourceAddressesInner() { + } + + /** + * Get the sourceAddresses property: A source IP address or CIDR range. + * + * @return the sourceAddresses value. + */ + public List sourceAddresses() { + return this.sourceAddresses; + } + + /** + * Set the sourceAddresses property: A source IP address or CIDR range. + * + * @param sourceAddresses the sourceAddresses value to set. + * @return the StreamSourceAddressesInner object itself. + */ + public StreamSourceAddressesInner withSourceAddresses(List sourceAddresses) { + this.sourceAddresses = sourceAddresses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("sourceAddresses", this.sourceAddresses, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StreamSourceAddressesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StreamSourceAddressesInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StreamSourceAddressesInner. + */ + public static StreamSourceAddressesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StreamSourceAddressesInner deserializedStreamSourceAddressesInner = new StreamSourceAddressesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceAddresses".equals(fieldName)) { + List sourceAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedStreamSourceAddressesInner.sourceAddresses = sourceAddresses; + } else { + reader.skipChildren(); + } + } + + return deserializedStreamSourceAddressesInner; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/ValidateSchemaResultInner.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/ValidateSchemaResultInner.java new file mode 100644 index 000000000000..e6d790a0a8aa --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/ValidateSchemaResultInner.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.models.ValidateSchemaStatus; +import java.io.IOException; + +/** + * Result of the schema validation. + */ +@Fluent +public final class ValidateSchemaResultInner implements JsonSerializable { + /* + * Validation status of the schema + */ + private ValidateSchemaStatus status; + + /* + * Message describing the schema validation + */ + private String message; + + /** + * Creates an instance of ValidateSchemaResultInner class. + */ + public ValidateSchemaResultInner() { + } + + /** + * Get the status property: Validation status of the schema. + * + * @return the status value. + */ + public ValidateSchemaStatus status() { + return this.status; + } + + /** + * Set the status property: Validation status of the schema. + * + * @param status the status value to set. + * @return the ValidateSchemaResultInner object itself. + */ + public ValidateSchemaResultInner withStatus(ValidateSchemaStatus status) { + this.status = status; + return this; + } + + /** + * Get the message property: Message describing the schema validation. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Message describing the schema validation. + * + * @param message the message value to set. + * @return the ValidateSchemaResultInner object itself. + */ + public ValidateSchemaResultInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidateSchemaResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidateSchemaResultInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidateSchemaResultInner. + */ + public static ValidateSchemaResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidateSchemaResultInner deserializedValidateSchemaResultInner = new ValidateSchemaResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedValidateSchemaResultInner.status = ValidateSchemaStatus.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedValidateSchemaResultInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidateSchemaResultInner; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/package-info.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/package-info.java new file mode 100644 index 000000000000..43ab1b5329bd --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for Azuredatatransferrp. + * Azure Data Transfer service resource provider. + */ +package com.azure.resourcemanager.azuredatatransfer.fluent.models; diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/package-info.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/package-info.java new file mode 100644 index 000000000000..b403d1e178c0 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for Azuredatatransferrp. + * Azure Data Transfer service resource provider. + */ +package com.azure.resourcemanager.azuredatatransfer.fluent; diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzureDataTransfersClientImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzureDataTransfersClientImpl.java new file mode 100644 index 000000000000..2f98f1e8536c --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzureDataTransfersClientImpl.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azuredatatransfer.fluent.AzureDataTransfersClient; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.SchemasListResultInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ValidateSchemaResultInner; +import com.azure.resourcemanager.azuredatatransfer.models.ListApprovedSchemasRequest; +import com.azure.resourcemanager.azuredatatransfer.models.Schema; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AzureDataTransfersClient. + */ +public final class AzureDataTransfersClientImpl implements AzureDataTransfersClient { + /** + * The proxy service used to perform REST calls. + */ + private final AzureDataTransfersService service; + + /** + * The service client containing this operation class. + */ + private final AzuredatatransferrpImpl client; + + /** + * Initializes an instance of AzureDataTransfersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AzureDataTransfersClientImpl(AzuredatatransferrpImpl client) { + this.service = RestProxy.create(AzureDataTransfersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzuredatatransferrpAzureDataTransfers to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzuredatatransferrpA") + public interface AzureDataTransfersService { + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.AzureDataTransfer/listApprovedSchemas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listApprovedSchemas(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ListApprovedSchemasRequest body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.AzureDataTransfer/listApprovedSchemas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listApprovedSchemasSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ListApprovedSchemasRequest body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.AzureDataTransfer/validateSchema") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateSchema(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") Schema body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.AzureDataTransfer/validateSchema") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response validateSchemaSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") Schema body, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists approved schemas for Azure Data Transfer. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listApprovedSchemasWithResponseAsync(ListApprovedSchemasRequest body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listApprovedSchemas(this.client.getEndpoint(), this.client.getApiVersion(), + body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists approved schemas for Azure Data Transfer. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listApprovedSchemasAsync(ListApprovedSchemasRequest body) { + return listApprovedSchemasWithResponseAsync(body).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists approved schemas for Azure Data Transfer. + * + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listApprovedSchemasWithResponse(ListApprovedSchemasRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.listApprovedSchemasSync(this.client.getEndpoint(), this.client.getApiVersion(), body, accept, + context); + } + + /** + * Lists approved schemas for Azure Data Transfer. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SchemasListResultInner listApprovedSchemas(ListApprovedSchemasRequest body) { + return listApprovedSchemasWithResponse(body, Context.NONE).getValue(); + } + + /** + * Validates a schema for Azure Data Transfer. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the schema validation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateSchemaWithResponseAsync(Schema body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validateSchema(this.client.getEndpoint(), this.client.getApiVersion(), body, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates a schema for Azure Data Transfer. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the schema validation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateSchemaAsync(Schema body) { + return validateSchemaWithResponseAsync(body).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validates a schema for Azure Data Transfer. + * + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the schema validation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateSchemaWithResponse(Schema body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.validateSchemaSync(this.client.getEndpoint(), this.client.getApiVersion(), body, accept, + context); + } + + /** + * Validates a schema for Azure Data Transfer. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the schema validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateSchemaResultInner validateSchema(Schema body) { + return validateSchemaWithResponse(body, Context.NONE).getValue(); + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureDataTransfersClientImpl.class); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzureDataTransfersImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzureDataTransfersImpl.java new file mode 100644 index 000000000000..4660e163b0fe --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzureDataTransfersImpl.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.azuredatatransfer.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.azuredatatransfer.fluent.AzureDataTransfersClient; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.SchemasListResultInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ValidateSchemaResultInner; +import com.azure.resourcemanager.azuredatatransfer.models.AzureDataTransfers; +import com.azure.resourcemanager.azuredatatransfer.models.ListApprovedSchemasRequest; +import com.azure.resourcemanager.azuredatatransfer.models.Schema; +import com.azure.resourcemanager.azuredatatransfer.models.SchemasListResult; +import com.azure.resourcemanager.azuredatatransfer.models.ValidateSchemaResult; + +public final class AzureDataTransfersImpl implements AzureDataTransfers { + private static final ClientLogger LOGGER = new ClientLogger(AzureDataTransfersImpl.class); + + private final AzureDataTransfersClient innerClient; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager; + + public AzureDataTransfersImpl(AzureDataTransfersClient innerClient, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listApprovedSchemasWithResponse(ListApprovedSchemasRequest body, + Context context) { + Response inner = this.serviceClient().listApprovedSchemasWithResponse(body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SchemasListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SchemasListResult listApprovedSchemas(ListApprovedSchemasRequest body) { + SchemasListResultInner inner = this.serviceClient().listApprovedSchemas(body); + if (inner != null) { + return new SchemasListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response validateSchemaWithResponse(Schema body, Context context) { + Response inner = this.serviceClient().validateSchemaWithResponse(body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ValidateSchemaResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ValidateSchemaResult validateSchema(Schema body) { + ValidateSchemaResultInner inner = this.serviceClient().validateSchema(body); + if (inner != null) { + return new ValidateSchemaResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private AzureDataTransfersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzuredatatransferrpBuilder.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzuredatatransferrpBuilder.java new file mode 100644 index 000000000000..b446bed9a0c9 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzuredatatransferrpBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.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 AzuredatatransferrpImpl type. + */ +@ServiceClientBuilder(serviceClients = { AzuredatatransferrpImpl.class }) +public final class AzuredatatransferrpBuilder { + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the AzuredatatransferrpBuilder. + */ + public AzuredatatransferrpBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the AzuredatatransferrpBuilder. + */ + public AzuredatatransferrpBuilder 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 AzuredatatransferrpBuilder. + */ + public AzuredatatransferrpBuilder 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 AzuredatatransferrpBuilder. + */ + public AzuredatatransferrpBuilder 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 AzuredatatransferrpBuilder. + */ + public AzuredatatransferrpBuilder 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 AzuredatatransferrpBuilder. + */ + public AzuredatatransferrpBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of AzuredatatransferrpImpl with the provided parameters. + * + * @return an instance of AzuredatatransferrpImpl. + */ + public AzuredatatransferrpImpl 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(); + AzuredatatransferrpImpl client = new AzuredatatransferrpImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzuredatatransferrpImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzuredatatransferrpImpl.java new file mode 100644 index 000000000000..a2b99a4aaa2c --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/AzuredatatransferrpImpl.java @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.azuredatatransfer.fluent.AzureDataTransfersClient; +import com.azure.resourcemanager.azuredatatransfer.fluent.Azuredatatransferrp; +import com.azure.resourcemanager.azuredatatransfer.fluent.ConnectionsClient; +import com.azure.resourcemanager.azuredatatransfer.fluent.FlowsClient; +import com.azure.resourcemanager.azuredatatransfer.fluent.OperationsClient; +import com.azure.resourcemanager.azuredatatransfer.fluent.PipelinesClient; +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 AzuredatatransferrpImpl type. + */ +@ServiceClient(builder = AzuredatatransferrpBuilder.class) +public final class AzuredatatransferrpImpl implements Azuredatatransferrp { + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * 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 AzureDataTransfersClient object to access its operations. + */ + private final AzureDataTransfersClient azureDataTransfers; + + /** + * Gets the AzureDataTransfersClient object to access its operations. + * + * @return the AzureDataTransfersClient object. + */ + public AzureDataTransfersClient getAzureDataTransfers() { + return this.azureDataTransfers; + } + + /** + * 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 ConnectionsClient object to access its operations. + */ + private final ConnectionsClient connections; + + /** + * Gets the ConnectionsClient object to access its operations. + * + * @return the ConnectionsClient object. + */ + public ConnectionsClient getConnections() { + return this.connections; + } + + /** + * The PipelinesClient object to access its operations. + */ + private final PipelinesClient pipelines; + + /** + * Gets the PipelinesClient object to access its operations. + * + * @return the PipelinesClient object. + */ + public PipelinesClient getPipelines() { + return this.pipelines; + } + + /** + * The FlowsClient object to access its operations. + */ + private final FlowsClient flows; + + /** + * Gets the FlowsClient object to access its operations. + * + * @return the FlowsClient object. + */ + public FlowsClient getFlows() { + return this.flows; + } + + /** + * Initializes an instance of Azuredatatransferrp 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. The value must be an UUID. + * @param endpoint server parameter. + */ + AzuredatatransferrpImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2025-04-11-preview"; + this.azureDataTransfers = new AzureDataTransfersClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.connections = new ConnectionsClientImpl(this); + this.pipelines = new PipelinesClientImpl(this); + this.flows = new FlowsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzuredatatransferrpImpl.class); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ConnectionImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ConnectionImpl.java new file mode 100644 index 000000000000..3a5845f82852 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ConnectionImpl.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.azuredatatransfer.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.azuredatatransfer.models.Connection; +import com.azure.resourcemanager.azuredatatransfer.models.ConnectionProperties; +import com.azure.resourcemanager.azuredatatransfer.models.ConnectionsPatch; +import com.azure.resourcemanager.azuredatatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.azuredatatransfer.models.PendingConnection; +import com.azure.resourcemanager.azuredatatransfer.models.PendingFlow; +import com.azure.resourcemanager.azuredatatransfer.models.ResourceBody; +import java.util.Collections; +import java.util.Map; + +public final class ConnectionImpl implements Connection, Connection.Definition, Connection.Update { + private ConnectionInner innerObject; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager 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 ConnectionProperties properties() { + return this.innerModel().properties(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String connectionName; + + private ConnectionsPatch updateProperties; + + public ConnectionImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Connection create() { + this.innerObject = serviceManager.serviceClient() + .getConnections() + .createOrUpdateWithResponse(resourceGroupName, connectionName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Connection create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConnections() + .createOrUpdateWithResponse(resourceGroupName, connectionName, this.innerModel(), context) + .getValue(); + return this; + } + + ConnectionImpl(String name, com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerObject = new ConnectionInner(); + this.serviceManager = serviceManager; + this.connectionName = name; + } + + public ConnectionImpl update() { + this.updateProperties = new ConnectionsPatch(); + return this; + } + + public Connection apply() { + this.innerObject = serviceManager.serviceClient() + .getConnections() + .update(resourceGroupName, connectionName, updateProperties, Context.NONE); + return this; + } + + public Connection apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConnections() + .update(resourceGroupName, connectionName, updateProperties, context); + return this; + } + + ConnectionImpl(ConnectionInner innerObject, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.connectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "connections"); + } + + public Connection refresh() { + this.innerObject = serviceManager.serviceClient() + .getConnections() + .getByResourceGroupWithResponse(resourceGroupName, connectionName, Context.NONE) + .getValue(); + return this; + } + + public Connection refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getConnections() + .getByResourceGroupWithResponse(resourceGroupName, connectionName, context) + .getValue(); + return this; + } + + public Connection link(ResourceBody body) { + return serviceManager.connections().link(resourceGroupName, connectionName, body); + } + + public Connection link(ResourceBody body, Context context) { + return serviceManager.connections().link(resourceGroupName, connectionName, body, context); + } + + public PagedIterable list() { + return serviceManager.connections().list(resourceGroupName, connectionName); + } + + public PagedIterable list(Context context) { + return serviceManager.connections().list(resourceGroupName, connectionName, context); + } + + public PagedIterable listPendingFlowsList() { + return serviceManager.connections().listPendingFlowsList(resourceGroupName, connectionName); + } + + public PagedIterable listPendingFlowsList(Context context) { + return serviceManager.connections().listPendingFlowsList(resourceGroupName, connectionName, context); + } + + public ConnectionImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ConnectionImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ConnectionImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public ConnectionImpl withProperties(ConnectionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public ConnectionImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateProperties.withIdentity(identity); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ConnectionsClientImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ConnectionsClientImpl.java new file mode 100644 index 000000000000..656c8880f6af --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ConnectionsClientImpl.java @@ -0,0 +1,2139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azuredatatransfer.fluent.ConnectionsClient; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PendingConnectionInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PendingFlowInner; +import com.azure.resourcemanager.azuredatatransfer.models.ConnectionListResult; +import com.azure.resourcemanager.azuredatatransfer.models.ConnectionsPatch; +import com.azure.resourcemanager.azuredatatransfer.models.PendingConnectionListResult; +import com.azure.resourcemanager.azuredatatransfer.models.PendingFlowListResult; +import com.azure.resourcemanager.azuredatatransfer.models.ResourceBody; +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 ConnectionsClient. + */ +public final class ConnectionsClientImpl implements ConnectionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ConnectionsService service; + + /** + * The service client containing this operation class. + */ + private final AzuredatatransferrpImpl client; + + /** + * Initializes an instance of ConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConnectionsClientImpl(AzuredatatransferrpImpl client) { + this.service + = RestProxy.create(ConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzuredatatransferrpConnections to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzuredatatransferrpC") + public interface ConnectionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureDataTransfer/connections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscription(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureDataTransfer/connections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @BodyParam("application/json") ConnectionInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @BodyParam("application/json") ConnectionInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, + @BodyParam("application/json") ConnectionsPatch properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, + @BodyParam("application/json") ConnectionsPatch properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/link") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> link(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @BodyParam("application/json") ResourceBody body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/link") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response linkSync(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @BodyParam("application/json") ResourceBody body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/listPendingConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/listPendingConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/listPendingFlows") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPendingFlowsList(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/listPendingFlows") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listPendingFlowsListSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPendingFlowsListNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listPendingFlowsListNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets connections in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a subscription along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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.listBySubscription(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets connections in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync() { + return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets connections in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listBySubscriptionSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets connections in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listBySubscriptionSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets connections in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription() { + return new PagedIterable<>(() -> listBySubscriptionSinglePage(), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * Gets connections in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription(Context context) { + return new PagedIterable<>(() -> listBySubscriptionSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * Gets connections in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets connections in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets connections in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets connections in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets connections in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * Gets connections in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * Gets connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String connectionName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, connectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String connectionName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, accept, context); + } + + /** + * Gets connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionInner getByResourceGroup(String resourceGroupName, String connectionName) { + return getByResourceGroupWithResponse(resourceGroupName, connectionName, Context.NONE).getValue(); + } + + /** + * Creates or updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param resource Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String connectionName, ConnectionInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param resource Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String connectionName, + ConnectionInner resource) { + return createOrUpdateWithResponseAsync(resourceGroupName, connectionName, resource) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param resource Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String connectionName, + ConnectionInner resource, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (resource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, resource, accept, context); + } + + /** + * Creates or updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param resource Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionInner createOrUpdate(String resourceGroupName, String connectionName, ConnectionInner resource) { + return createOrUpdateWithResponse(resourceGroupName, connectionName, resource, Context.NONE).getValue(); + } + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param properties Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String connectionName, + ConnectionsPatch properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName 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.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param properties Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String connectionName, + ConnectionsPatch properties) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (properties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, properties, accept, Context.NONE); + } + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param properties Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String connectionName, + ConnectionsPatch properties, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (properties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, properties, accept, context); + } + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param properties Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConnectionInner> beginUpdateAsync(String resourceGroupName, + String connectionName, ConnectionsPatch properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, connectionName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ConnectionInner.class, ConnectionInner.class, this.client.getContext()); + } + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param properties Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionInner> beginUpdate(String resourceGroupName, + String connectionName, ConnectionsPatch properties) { + Response response = updateWithResponse(resourceGroupName, connectionName, properties); + return this.client.getLroResult(response, ConnectionInner.class, + ConnectionInner.class, Context.NONE); + } + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param properties Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionInner> beginUpdate(String resourceGroupName, + String connectionName, ConnectionsPatch properties, Context context) { + Response response = updateWithResponse(resourceGroupName, connectionName, properties, context); + return this.client.getLroResult(response, ConnectionInner.class, + ConnectionInner.class, context); + } + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param properties Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String connectionName, + ConnectionsPatch properties) { + return beginUpdateAsync(resourceGroupName, connectionName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param properties Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionInner update(String resourceGroupName, String connectionName, ConnectionsPatch properties) { + return beginUpdate(resourceGroupName, connectionName, properties).getFinalResult(); + } + + /** + * Updates the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param properties Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionInner update(String resourceGroupName, String connectionName, ConnectionsPatch properties, + Context context) { + return beginUpdate(resourceGroupName, connectionName, properties, context).getFinalResult(); + } + + /** + * Deletes the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 connectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String connectionName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, accept, Context.NONE); + } + + /** + * Deletes the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, accept, context); + } + + /** + * Deletes the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 connectionName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, connectionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 connectionName) { + Response response = deleteWithResponse(resourceGroupName, connectionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 connectionName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, connectionName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String connectionName) { + return beginDeleteAsync(resourceGroupName, connectionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String connectionName) { + beginDelete(resourceGroupName, connectionName).getFinalResult(); + } + + /** + * Deletes the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String connectionName, Context context) { + beginDelete(resourceGroupName, connectionName, context).getFinalResult(); + } + + /** + * Links the connection to its pending connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> linkWithResponseAsync(String resourceGroupName, String connectionName, + ResourceBody body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.link(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Links the connection to its pending connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response linkWithResponse(String resourceGroupName, String connectionName, ResourceBody body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.linkSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectionName, body, accept, Context.NONE); + } + + /** + * Links the connection to its pending connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response linkWithResponse(String resourceGroupName, String connectionName, ResourceBody body, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.linkSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectionName, body, accept, context); + } + + /** + * Links the connection to its pending connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConnectionInner> beginLinkAsync(String resourceGroupName, + String connectionName, ResourceBody body) { + Mono>> mono = linkWithResponseAsync(resourceGroupName, connectionName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ConnectionInner.class, ConnectionInner.class, this.client.getContext()); + } + + /** + * Links the connection to its pending connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionInner> beginLink(String resourceGroupName, + String connectionName, ResourceBody body) { + Response response = linkWithResponse(resourceGroupName, connectionName, body); + return this.client.getLroResult(response, ConnectionInner.class, + ConnectionInner.class, Context.NONE); + } + + /** + * Links the connection to its pending connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionInner> beginLink(String resourceGroupName, + String connectionName, ResourceBody body, Context context) { + Response response = linkWithResponse(resourceGroupName, connectionName, body, context); + return this.client.getLroResult(response, ConnectionInner.class, + ConnectionInner.class, context); + } + + /** + * Links the connection to its pending connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono linkAsync(String resourceGroupName, String connectionName, ResourceBody body) { + return beginLinkAsync(resourceGroupName, connectionName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Links the connection to its pending connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionInner link(String resourceGroupName, String connectionName, ResourceBody body) { + return beginLink(resourceGroupName, connectionName, body).getFinalResult(); + } + + /** + * Links the connection to its pending connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionInner link(String resourceGroupName, String connectionName, ResourceBody body, Context context) { + return beginLink(resourceGroupName, connectionName, body, context).getFinalResult(); + } + + /** + * Lists all pending connections for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all pending connections for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingConnection list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String connectionName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, connectionName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all pending connections for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String connectionName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectionName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all pending connections for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String connectionName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectionName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all pending connections for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingConnection list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String connectionName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, connectionName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists all pending connections for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingConnection list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String connectionName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, connectionName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Lists all pending flows for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingFlow list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPendingFlowsListSinglePageAsync(String resourceGroupName, + String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listPendingFlowsList(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all pending flows for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingFlow list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPendingFlowsListAsync(String resourceGroupName, String connectionName) { + return new PagedFlux<>(() -> listPendingFlowsListSinglePageAsync(resourceGroupName, connectionName), + nextLink -> listPendingFlowsListNextSinglePageAsync(nextLink)); + } + + /** + * Lists all pending flows for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingFlow list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPendingFlowsListSinglePage(String resourceGroupName, + String connectionName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listPendingFlowsListSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all pending flows for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingFlow list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPendingFlowsListSinglePage(String resourceGroupName, + String connectionName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listPendingFlowsListSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all pending flows for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingFlow list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPendingFlowsList(String resourceGroupName, String connectionName) { + return new PagedIterable<>(() -> listPendingFlowsListSinglePage(resourceGroupName, connectionName), + nextLink -> listPendingFlowsListNextSinglePage(nextLink)); + } + + /** + * Lists all pending flows for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingFlow list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPendingFlowsList(String resourceGroupName, String connectionName, + Context context) { + return new PagedIterable<>(() -> listPendingFlowsListSinglePage(resourceGroupName, connectionName, context), + nextLink -> listPendingFlowsListNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Connection list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Connection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Connection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Connection list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Connection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Connection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingConnection list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingConnection list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingFlow list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPendingFlowsListNextSinglePageAsync(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.listPendingFlowsListNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingFlow list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPendingFlowsListNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listPendingFlowsListNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingFlow list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPendingFlowsListNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listPendingFlowsListNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionsClientImpl.class); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ConnectionsImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ConnectionsImpl.java new file mode 100644 index 000000000000..0c757b1050b0 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ConnectionsImpl.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.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.azuredatatransfer.fluent.ConnectionsClient; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PendingConnectionInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PendingFlowInner; +import com.azure.resourcemanager.azuredatatransfer.models.Connection; +import com.azure.resourcemanager.azuredatatransfer.models.Connections; +import com.azure.resourcemanager.azuredatatransfer.models.PendingConnection; +import com.azure.resourcemanager.azuredatatransfer.models.PendingFlow; +import com.azure.resourcemanager.azuredatatransfer.models.ResourceBody; + +public final class ConnectionsImpl implements Connections { + private static final ClientLogger LOGGER = new ClientLogger(ConnectionsImpl.class); + + private final ConnectionsClient innerClient; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager; + + public ConnectionsImpl(ConnectionsClient innerClient, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listBySubscription() { + PagedIterable inner = this.serviceClient().listBySubscription(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscription(Context context) { + PagedIterable inner = this.serviceClient().listBySubscription(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ConnectionImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String connectionName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, connectionName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Connection getByResourceGroup(String resourceGroupName, String connectionName) { + ConnectionInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, connectionName); + if (inner != null) { + return new ConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String connectionName) { + this.serviceClient().delete(resourceGroupName, connectionName); + } + + public void delete(String resourceGroupName, String connectionName, Context context) { + this.serviceClient().delete(resourceGroupName, connectionName, context); + } + + public Connection link(String resourceGroupName, String connectionName, ResourceBody body) { + ConnectionInner inner = this.serviceClient().link(resourceGroupName, connectionName, body); + if (inner != null) { + return new ConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Connection link(String resourceGroupName, String connectionName, ResourceBody body, Context context) { + ConnectionInner inner = this.serviceClient().link(resourceGroupName, connectionName, body, context); + if (inner != null) { + return new ConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String connectionName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, connectionName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PendingConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String connectionName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, connectionName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PendingConnectionImpl(inner1, this.manager())); + } + + public PagedIterable listPendingFlowsList(String resourceGroupName, String connectionName) { + PagedIterable inner + = this.serviceClient().listPendingFlowsList(resourceGroupName, connectionName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PendingFlowImpl(inner1, this.manager())); + } + + public PagedIterable listPendingFlowsList(String resourceGroupName, String connectionName, + Context context) { + PagedIterable inner + = this.serviceClient().listPendingFlowsList(resourceGroupName, connectionName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PendingFlowImpl(inner1, this.manager())); + } + + public Connection getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, connectionName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, connectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.delete(resourceGroupName, connectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.delete(resourceGroupName, connectionName, context); + } + + private ConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } + + public ConnectionImpl define(String name) { + return new ConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowImpl.java new file mode 100644 index 000000000000..7a5cbc851da4 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowImpl.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.FlowInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.FlowPropertiesInner; +import com.azure.resourcemanager.azuredatatransfer.models.Flow; +import com.azure.resourcemanager.azuredatatransfer.models.FlowProperties; +import com.azure.resourcemanager.azuredatatransfer.models.FlowsPatch; +import com.azure.resourcemanager.azuredatatransfer.models.GetDestinationEndpointPortsResult; +import com.azure.resourcemanager.azuredatatransfer.models.GetDestinationEndpointsResult; +import com.azure.resourcemanager.azuredatatransfer.models.GetStreamConnectionStringResult; +import com.azure.resourcemanager.azuredatatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.azuredatatransfer.models.Plan; +import com.azure.resourcemanager.azuredatatransfer.models.ResourceBody; +import com.azure.resourcemanager.azuredatatransfer.models.SetDestinationEndpointPorts; +import com.azure.resourcemanager.azuredatatransfer.models.SetDestinationEndpoints; +import com.azure.resourcemanager.azuredatatransfer.models.SetSourceAddresses; +import com.azure.resourcemanager.azuredatatransfer.models.SetStreamPassphrase; +import com.azure.resourcemanager.azuredatatransfer.models.StreamSourceAddresses; +import java.util.Collections; +import java.util.Map; + +public final class FlowImpl implements Flow, Flow.Definition, Flow.Update { + private FlowInner innerObject; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager 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 FlowProperties properties() { + FlowPropertiesInner inner = this.innerModel().properties(); + if (inner != null) { + return new FlowPropertiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Plan plan() { + return this.innerModel().plan(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public FlowInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String connectionName; + + private String flowName; + + private FlowsPatch updateProperties; + + public FlowImpl withExistingConnection(String resourceGroupName, String connectionName) { + this.resourceGroupName = resourceGroupName; + this.connectionName = connectionName; + return this; + } + + public Flow create() { + this.innerObject = serviceManager.serviceClient() + .getFlows() + .createOrUpdateWithResponse(resourceGroupName, connectionName, flowName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Flow create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFlows() + .createOrUpdateWithResponse(resourceGroupName, connectionName, flowName, this.innerModel(), context) + .getValue(); + return this; + } + + FlowImpl(String name, com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerObject = new FlowInner(); + this.serviceManager = serviceManager; + this.flowName = name; + } + + public FlowImpl update() { + this.updateProperties = new FlowsPatch(); + return this; + } + + public Flow apply() { + this.innerObject = serviceManager.serviceClient() + .getFlows() + .update(resourceGroupName, connectionName, flowName, updateProperties, Context.NONE); + return this; + } + + public Flow apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFlows() + .update(resourceGroupName, connectionName, flowName, updateProperties, context); + return this; + } + + FlowImpl(FlowInner innerObject, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.connectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "connections"); + this.flowName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "flows"); + } + + public Flow refresh() { + this.innerObject = serviceManager.serviceClient() + .getFlows() + .getWithResponse(resourceGroupName, connectionName, flowName, Context.NONE) + .getValue(); + return this; + } + + public Flow refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getFlows() + .getWithResponse(resourceGroupName, connectionName, flowName, context) + .getValue(); + return this; + } + + public Flow disable() { + return serviceManager.flows().disable(resourceGroupName, connectionName, flowName); + } + + public Flow disable(Context context) { + return serviceManager.flows().disable(resourceGroupName, connectionName, flowName, context); + } + + public Flow enable() { + return serviceManager.flows().enable(resourceGroupName, connectionName, flowName); + } + + public Flow enable(Context context) { + return serviceManager.flows().enable(resourceGroupName, connectionName, flowName, context); + } + + public Flow generatePassphrase() { + return serviceManager.flows().generatePassphrase(resourceGroupName, connectionName, flowName); + } + + public Flow generatePassphrase(Context context) { + return serviceManager.flows().generatePassphrase(resourceGroupName, connectionName, flowName, context); + } + + public Response getDestinationEndpointPortsWithResponse(Context context) { + return serviceManager.flows() + .getDestinationEndpointPortsWithResponse(resourceGroupName, connectionName, flowName, context); + } + + public GetDestinationEndpointPortsResult getDestinationEndpointPorts() { + return serviceManager.flows().getDestinationEndpointPorts(resourceGroupName, connectionName, flowName); + } + + public Response getDestinationEndpointsWithResponse(Context context) { + return serviceManager.flows() + .getDestinationEndpointsWithResponse(resourceGroupName, connectionName, flowName, context); + } + + public GetDestinationEndpointsResult getDestinationEndpoints() { + return serviceManager.flows().getDestinationEndpoints(resourceGroupName, connectionName, flowName); + } + + public Response getSourceAddressesWithResponse(Context context) { + return serviceManager.flows() + .getSourceAddressesWithResponse(resourceGroupName, connectionName, flowName, context); + } + + public StreamSourceAddresses getSourceAddresses() { + return serviceManager.flows().getSourceAddresses(resourceGroupName, connectionName, flowName); + } + + public Response getStreamConnectionStringWithResponse(Context context) { + return serviceManager.flows() + .getStreamConnectionStringWithResponse(resourceGroupName, connectionName, flowName, context); + } + + public GetStreamConnectionStringResult getStreamConnectionString() { + return serviceManager.flows().getStreamConnectionString(resourceGroupName, connectionName, flowName); + } + + public Flow link(ResourceBody body) { + return serviceManager.flows().link(resourceGroupName, connectionName, flowName, body); + } + + public Flow link(ResourceBody body, Context context) { + return serviceManager.flows().link(resourceGroupName, connectionName, flowName, body, context); + } + + public Flow setDestinationEndpointPorts(SetDestinationEndpointPorts body) { + return serviceManager.flows().setDestinationEndpointPorts(resourceGroupName, connectionName, flowName, body); + } + + public Flow setDestinationEndpointPorts(SetDestinationEndpointPorts body, Context context) { + return serviceManager.flows() + .setDestinationEndpointPorts(resourceGroupName, connectionName, flowName, body, context); + } + + public Flow setDestinationEndpoints(SetDestinationEndpoints body) { + return serviceManager.flows().setDestinationEndpoints(resourceGroupName, connectionName, flowName, body); + } + + public Flow setDestinationEndpoints(SetDestinationEndpoints body, Context context) { + return serviceManager.flows() + .setDestinationEndpoints(resourceGroupName, connectionName, flowName, body, context); + } + + public Flow setPassphrase(SetStreamPassphrase body) { + return serviceManager.flows().setPassphrase(resourceGroupName, connectionName, flowName, body); + } + + public Flow setPassphrase(SetStreamPassphrase body, Context context) { + return serviceManager.flows().setPassphrase(resourceGroupName, connectionName, flowName, body, context); + } + + public Flow setSourceAddresses(SetSourceAddresses body) { + return serviceManager.flows().setSourceAddresses(resourceGroupName, connectionName, flowName, body); + } + + public Flow setSourceAddresses(SetSourceAddresses body, Context context) { + return serviceManager.flows().setSourceAddresses(resourceGroupName, connectionName, flowName, body, context); + } + + public FlowImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public FlowImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public FlowImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public FlowImpl withProperties(FlowPropertiesInner properties) { + this.innerModel().withProperties(properties); + return this; + } + + public FlowImpl withPlan(Plan plan) { + this.innerModel().withPlan(plan); + return this; + } + + public FlowImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateProperties.withIdentity(identity); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowPropertiesImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowPropertiesImpl.java new file mode 100644 index 000000000000..aef277e4c2a9 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowPropertiesImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.implementation; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.FlowPropertiesInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.StreamSourceAddressesInner; +import com.azure.resourcemanager.azuredatatransfer.models.ApiFlowOptions; +import com.azure.resourcemanager.azuredatatransfer.models.DataType; +import com.azure.resourcemanager.azuredatatransfer.models.FlowProperties; +import com.azure.resourcemanager.azuredatatransfer.models.FlowStatus; +import com.azure.resourcemanager.azuredatatransfer.models.FlowType; +import com.azure.resourcemanager.azuredatatransfer.models.ForceDisabledStatus; +import com.azure.resourcemanager.azuredatatransfer.models.LinkStatus; +import com.azure.resourcemanager.azuredatatransfer.models.MessagingOptions; +import com.azure.resourcemanager.azuredatatransfer.models.ProvisioningState; +import com.azure.resourcemanager.azuredatatransfer.models.Schema; +import com.azure.resourcemanager.azuredatatransfer.models.SelectedResource; +import com.azure.resourcemanager.azuredatatransfer.models.StreamProtocol; +import com.azure.resourcemanager.azuredatatransfer.models.StreamSourceAddresses; +import java.util.Collections; +import java.util.List; + +public final class FlowPropertiesImpl implements FlowProperties { + private FlowPropertiesInner innerObject; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager; + + FlowPropertiesImpl(FlowPropertiesInner innerObject, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public SelectedResource connection() { + return this.innerModel().connection(); + } + + public String flowId() { + return this.innerModel().flowId(); + } + + public String keyVaultUri() { + return this.innerModel().keyVaultUri(); + } + + public LinkStatus linkStatus() { + return this.innerModel().linkStatus(); + } + + public String linkedFlowId() { + return this.innerModel().linkedFlowId(); + } + + public FlowStatus status() { + return this.innerModel().status(); + } + + public List forceDisabledStatus() { + List inner = this.innerModel().forceDisabledStatus(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String storageAccountName() { + return this.innerModel().storageAccountName(); + } + + public String storageAccountId() { + return this.innerModel().storageAccountId(); + } + + public String storageContainerName() { + return this.innerModel().storageContainerName(); + } + + public String storageTableName() { + return this.innerModel().storageTableName(); + } + + public String serviceBusQueueId() { + return this.innerModel().serviceBusQueueId(); + } + + public FlowType flowType() { + return this.innerModel().flowType(); + } + + public DataType dataType() { + return this.innerModel().dataType(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List policies() { + List inner = this.innerModel().policies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Schema schema() { + return this.innerModel().schema(); + } + + public MessagingOptions messagingOptions() { + return this.innerModel().messagingOptions(); + } + + public ApiFlowOptions apiFlowOptions() { + return this.innerModel().apiFlowOptions(); + } + + public String customerManagedKeyVaultUri() { + return this.innerModel().customerManagedKeyVaultUri(); + } + + public String streamId() { + return this.innerModel().streamId(); + } + + public StreamProtocol streamProtocol() { + return this.innerModel().streamProtocol(); + } + + public Long streamLatency() { + return this.innerModel().streamLatency(); + } + + public String passphrase() { + return this.innerModel().passphrase(); + } + + public StreamSourceAddresses sourceAddresses() { + StreamSourceAddressesInner inner = this.innerModel().sourceAddresses(); + if (inner != null) { + return new StreamSourceAddressesImpl(inner, this.manager()); + } else { + return null; + } + } + + public List destinationEndpoints() { + List inner = this.innerModel().destinationEndpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List destinationEndpointPorts() { + List inner = this.innerModel().destinationEndpointPorts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String eventHubId() { + return this.innerModel().eventHubId(); + } + + public String consumerGroup() { + return this.innerModel().consumerGroup(); + } + + public FlowPropertiesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowsClientImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowsClientImpl.java new file mode 100644 index 000000000000..72130a4d7deb --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowsClientImpl.java @@ -0,0 +1,3882 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azuredatatransfer.fluent.FlowsClient; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.FlowInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.GetDestinationEndpointPortsResultInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.GetDestinationEndpointsResultInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.GetStreamConnectionStringResultInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.StreamSourceAddressesInner; +import com.azure.resourcemanager.azuredatatransfer.models.FlowListResult; +import com.azure.resourcemanager.azuredatatransfer.models.FlowsPatch; +import com.azure.resourcemanager.azuredatatransfer.models.ResourceBody; +import com.azure.resourcemanager.azuredatatransfer.models.SetDestinationEndpointPorts; +import com.azure.resourcemanager.azuredatatransfer.models.SetDestinationEndpoints; +import com.azure.resourcemanager.azuredatatransfer.models.SetSourceAddresses; +import com.azure.resourcemanager.azuredatatransfer.models.SetStreamPassphrase; +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 FlowsClient. + */ +public final class FlowsClientImpl implements FlowsClient { + /** + * The proxy service used to perform REST calls. + */ + private final FlowsService service; + + /** + * The service client containing this operation class. + */ + private final AzuredatatransferrpImpl client; + + /** + * Initializes an instance of FlowsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FlowsClientImpl(AzuredatatransferrpImpl client) { + this.service = RestProxy.create(FlowsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzuredatatransferrpFlows to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzuredatatransferrpF") + public interface FlowsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByConnection(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByConnectionSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @BodyParam("application/json") FlowInner resource, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @BodyParam("application/json") FlowInner resource, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @BodyParam("application/json") FlowsPatch properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @BodyParam("application/json") FlowsPatch properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/disable") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disable(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/disable") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response disableSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/enable") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> enable(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/enable") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response enableSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/generatePassphrase") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generatePassphrase(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/generatePassphrase") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response generatePassphraseSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/getDestinationEndpointPorts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDestinationEndpointPorts( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/getDestinationEndpointPorts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getDestinationEndpointPortsSync( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/getDestinationEndpoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDestinationEndpoints(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/getDestinationEndpoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getDestinationEndpointsSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/getSourceAddresses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSourceAddresses(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/getSourceAddresses") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSourceAddressesSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/getStreamConnectionString") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getStreamConnectionString( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/getStreamConnectionString") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getStreamConnectionStringSync( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/link") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> link(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @BodyParam("application/json") ResourceBody body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/link") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response linkSync(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @BodyParam("application/json") ResourceBody body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setDestinationEndpointPorts") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setDestinationEndpointPorts(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @BodyParam("application/json") SetDestinationEndpointPorts body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setDestinationEndpointPorts") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response setDestinationEndpointPortsSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @BodyParam("application/json") SetDestinationEndpointPorts body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setDestinationEndpoints") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setDestinationEndpoints(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @BodyParam("application/json") SetDestinationEndpoints body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setDestinationEndpoints") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response setDestinationEndpointsSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @BodyParam("application/json") SetDestinationEndpoints body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setPassphrase") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setPassphrase(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @BodyParam("application/json") SetStreamPassphrase body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setPassphrase") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response setPassphraseSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @BodyParam("application/json") SetStreamPassphrase body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setSourceAddresses") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setSourceAddresses(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @BodyParam("application/json") SetSourceAddresses body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/connections/{connectionName}/flows/{flowName}/setSourceAddresses") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response setSourceAddressesSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("connectionName") String connectionName, @PathParam("flowName") String flowName, + @BodyParam("application/json") SetSourceAddresses body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByConnectionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByConnectionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets flows in a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flows in a connection along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByConnectionSinglePageAsync(String resourceGroupName, + String connectionName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByConnection(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets flows in a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flows in a connection as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByConnectionAsync(String resourceGroupName, String connectionName) { + return new PagedFlux<>(() -> listByConnectionSinglePageAsync(resourceGroupName, connectionName), + nextLink -> listByConnectionNextSinglePageAsync(nextLink)); + } + + /** + * Gets flows in a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flows in a connection along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByConnectionSinglePage(String resourceGroupName, String connectionName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByConnectionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets flows in a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flows in a connection along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByConnectionSinglePage(String resourceGroupName, String connectionName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByConnectionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets flows in a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flows in a connection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByConnection(String resourceGroupName, String connectionName) { + return new PagedIterable<>(() -> listByConnectionSinglePage(resourceGroupName, connectionName), + nextLink -> listByConnectionNextSinglePage(nextLink)); + } + + /** + * Gets flows in a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flows in a connection as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByConnection(String resourceGroupName, String connectionName, Context context) { + return new PagedIterable<>(() -> listByConnectionSinglePage(resourceGroupName, connectionName, context), + nextLink -> listByConnectionNextSinglePage(nextLink, context)); + } + + /** + * Gets flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flow resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String connectionName, + String flowName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flow resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String connectionName, String flowName) { + return getWithResponseAsync(resourceGroupName, connectionName, flowName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flow resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String connectionName, String flowName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectionName, flowName, accept, context); + } + + /** + * Gets flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flow resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner get(String resourceGroupName, String connectionName, String flowName) { + return getWithResponse(resourceGroupName, connectionName, flowName, Context.NONE).getValue(); + } + + /** + * Creates or updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param resource Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String connectionName, + String flowName, FlowInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, resource, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param resource Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String connectionName, String flowName, + FlowInner resource) { + return createOrUpdateWithResponseAsync(resourceGroupName, connectionName, flowName, resource) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param resource Flow body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String connectionName, + String flowName, FlowInner resource, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (resource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, resource, accept, context); + } + + /** + * Creates or updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param resource Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner createOrUpdate(String resourceGroupName, String connectionName, String flowName, + FlowInner resource) { + return createOrUpdateWithResponse(resourceGroupName, connectionName, flowName, resource, Context.NONE) + .getValue(); + } + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param properties Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String connectionName, + String flowName, FlowsPatch properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName 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.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param properties Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String connectionName, String flowName, + FlowsPatch properties) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (properties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, properties, accept, + Context.NONE); + } + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param properties Flow body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String connectionName, String flowName, + FlowsPatch properties, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (properties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, properties, accept, context); + } + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param properties Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FlowInner> beginUpdateAsync(String resourceGroupName, + String connectionName, String flowName, FlowsPatch properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, connectionName, flowName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FlowInner.class, + FlowInner.class, this.client.getContext()); + } + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param properties Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginUpdate(String resourceGroupName, String connectionName, + String flowName, FlowsPatch properties) { + Response response = updateWithResponse(resourceGroupName, connectionName, flowName, properties); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, Context.NONE); + } + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param properties Flow body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginUpdate(String resourceGroupName, String connectionName, + String flowName, FlowsPatch properties, Context context) { + Response response + = updateWithResponse(resourceGroupName, connectionName, flowName, properties, context); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, context); + } + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param properties Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String connectionName, String flowName, + FlowsPatch properties) { + return beginUpdateAsync(resourceGroupName, connectionName, flowName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param properties Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner update(String resourceGroupName, String connectionName, String flowName, FlowsPatch properties) { + return beginUpdate(resourceGroupName, connectionName, flowName, properties).getFinalResult(); + } + + /** + * Updates the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param properties Flow body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner update(String resourceGroupName, String connectionName, String flowName, FlowsPatch properties, + Context context) { + return beginUpdate(resourceGroupName, connectionName, flowName, properties, context).getFinalResult(); + } + + /** + * Deletes the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 connectionName, + String flowName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String connectionName, String flowName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, Context.NONE); + } + + /** + * Deletes the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String connectionName, String flowName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context); + } + + /** + * Deletes the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 connectionName, + String flowName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, connectionName, flowName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 connectionName, + String flowName) { + Response response = deleteWithResponse(resourceGroupName, connectionName, flowName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 connectionName, + String flowName, Context context) { + Response response = deleteWithResponse(resourceGroupName, connectionName, flowName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String connectionName, String flowName) { + return beginDeleteAsync(resourceGroupName, connectionName, flowName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String connectionName, String flowName) { + beginDelete(resourceGroupName, connectionName, flowName).getFinalResult(); + } + + /** + * Deletes the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String connectionName, String flowName, Context context) { + beginDelete(resourceGroupName, connectionName, flowName, context).getFinalResult(); + } + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableWithResponseAsync(String resourceGroupName, String connectionName, + String flowName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.disable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response disableWithResponse(String resourceGroupName, String connectionName, String flowName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.disableSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, Context.NONE); + } + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response disableWithResponse(String resourceGroupName, String connectionName, String flowName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.disableSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context); + } + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FlowInner> beginDisableAsync(String resourceGroupName, + String connectionName, String flowName) { + Mono>> mono = disableWithResponseAsync(resourceGroupName, connectionName, flowName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FlowInner.class, + FlowInner.class, this.client.getContext()); + } + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginDisable(String resourceGroupName, String connectionName, + String flowName) { + Response response = disableWithResponse(resourceGroupName, connectionName, flowName); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, Context.NONE); + } + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginDisable(String resourceGroupName, String connectionName, + String flowName, Context context) { + Response response = disableWithResponse(resourceGroupName, connectionName, flowName, context); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, context); + } + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableAsync(String resourceGroupName, String connectionName, String flowName) { + return beginDisableAsync(resourceGroupName, connectionName, flowName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner disable(String resourceGroupName, String connectionName, String flowName) { + return beginDisable(resourceGroupName, connectionName, flowName).getFinalResult(); + } + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner disable(String resourceGroupName, String connectionName, String flowName, Context context) { + return beginDisable(resourceGroupName, connectionName, flowName, context).getFinalResult(); + } + + /** + * Enables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableWithResponseAsync(String resourceGroupName, String connectionName, + String flowName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.enable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Enables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response enableWithResponse(String resourceGroupName, String connectionName, String flowName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.enableSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, Context.NONE); + } + + /** + * Enables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response enableWithResponse(String resourceGroupName, String connectionName, String flowName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.enableSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context); + } + + /** + * Enables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FlowInner> beginEnableAsync(String resourceGroupName, + String connectionName, String flowName) { + Mono>> mono = enableWithResponseAsync(resourceGroupName, connectionName, flowName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FlowInner.class, + FlowInner.class, this.client.getContext()); + } + + /** + * Enables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginEnable(String resourceGroupName, String connectionName, + String flowName) { + Response response = enableWithResponse(resourceGroupName, connectionName, flowName); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, Context.NONE); + } + + /** + * Enables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginEnable(String resourceGroupName, String connectionName, + String flowName, Context context) { + Response response = enableWithResponse(resourceGroupName, connectionName, flowName, context); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, context); + } + + /** + * Enables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableAsync(String resourceGroupName, String connectionName, String flowName) { + return beginEnableAsync(resourceGroupName, connectionName, flowName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner enable(String resourceGroupName, String connectionName, String flowName) { + return beginEnable(resourceGroupName, connectionName, flowName).getFinalResult(); + } + + /** + * Enables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner enable(String resourceGroupName, String connectionName, String flowName, Context context) { + return beginEnable(resourceGroupName, connectionName, flowName, context).getFinalResult(); + } + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generatePassphraseWithResponseAsync(String resourceGroupName, + String connectionName, String flowName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.generatePassphrase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generatePassphraseWithResponse(String resourceGroupName, String connectionName, + String flowName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.generatePassphraseSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, Context.NONE); + } + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generatePassphraseWithResponse(String resourceGroupName, String connectionName, + String flowName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.generatePassphraseSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context); + } + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FlowInner> beginGeneratePassphraseAsync(String resourceGroupName, + String connectionName, String flowName) { + Mono>> mono + = generatePassphraseWithResponseAsync(resourceGroupName, connectionName, flowName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FlowInner.class, + FlowInner.class, this.client.getContext()); + } + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginGeneratePassphrase(String resourceGroupName, + String connectionName, String flowName) { + Response response = generatePassphraseWithResponse(resourceGroupName, connectionName, flowName); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, Context.NONE); + } + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginGeneratePassphrase(String resourceGroupName, + String connectionName, String flowName, Context context) { + Response response + = generatePassphraseWithResponse(resourceGroupName, connectionName, flowName, context); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, context); + } + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generatePassphraseAsync(String resourceGroupName, String connectionName, String flowName) { + return beginGeneratePassphraseAsync(resourceGroupName, connectionName, flowName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner generatePassphrase(String resourceGroupName, String connectionName, String flowName) { + return beginGeneratePassphrase(resourceGroupName, connectionName, flowName).getFinalResult(); + } + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner generatePassphrase(String resourceGroupName, String connectionName, String flowName, + Context context) { + return beginGeneratePassphrase(resourceGroupName, connectionName, flowName, context).getFinalResult(); + } + + /** + * Get the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoint ports for the specified flow and stream ID along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getDestinationEndpointPortsWithResponseAsync(String resourceGroupName, String connectionName, String flowName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getDestinationEndpointPorts(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoint ports for the specified flow and stream ID on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDestinationEndpointPortsAsync(String resourceGroupName, + String connectionName, String flowName) { + return getDestinationEndpointPortsWithResponseAsync(resourceGroupName, connectionName, flowName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoint ports for the specified flow and stream ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDestinationEndpointPortsWithResponse( + String resourceGroupName, String connectionName, String flowName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getDestinationEndpointPortsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context); + } + + /** + * Get the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoint ports for the specified flow and stream ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetDestinationEndpointPortsResultInner getDestinationEndpointPorts(String resourceGroupName, + String connectionName, String flowName) { + return getDestinationEndpointPortsWithResponse(resourceGroupName, connectionName, flowName, Context.NONE) + .getValue(); + } + + /** + * Get the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoints for the specified flow and stream ID along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getDestinationEndpointsWithResponseAsync(String resourceGroupName, String connectionName, String flowName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getDestinationEndpoints(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoints for the specified flow and stream ID on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDestinationEndpointsAsync(String resourceGroupName, + String connectionName, String flowName) { + return getDestinationEndpointsWithResponseAsync(resourceGroupName, connectionName, flowName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoints for the specified flow and stream ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDestinationEndpointsWithResponse(String resourceGroupName, + String connectionName, String flowName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getDestinationEndpointsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context); + } + + /** + * Get the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoints for the specified flow and stream ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetDestinationEndpointsResultInner getDestinationEndpoints(String resourceGroupName, String connectionName, + String flowName) { + return getDestinationEndpointsWithResponse(resourceGroupName, connectionName, flowName, Context.NONE) + .getValue(); + } + + /** + * Get the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source addresses for the specified flow along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSourceAddressesWithResponseAsync(String resourceGroupName, + String connectionName, String flowName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getSourceAddresses(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source addresses for the specified flow on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSourceAddressesAsync(String resourceGroupName, String connectionName, + String flowName) { + return getSourceAddressesWithResponseAsync(resourceGroupName, connectionName, flowName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source addresses for the specified flow along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSourceAddressesWithResponse(String resourceGroupName, + String connectionName, String flowName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSourceAddressesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context); + } + + /** + * Get the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source addresses for the specified flow. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StreamSourceAddressesInner getSourceAddresses(String resourceGroupName, String connectionName, + String flowName) { + return getSourceAddressesWithResponse(resourceGroupName, connectionName, flowName, Context.NONE).getValue(); + } + + /** + * Get the connection string for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection string for the specified flow along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getStreamConnectionStringWithResponseAsync(String resourceGroupName, String connectionName, String flowName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getStreamConnectionString(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the connection string for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection string for the specified flow on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getStreamConnectionStringAsync(String resourceGroupName, + String connectionName, String flowName) { + return getStreamConnectionStringWithResponseAsync(resourceGroupName, connectionName, flowName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the connection string for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection string for the specified flow along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getStreamConnectionStringWithResponse( + String resourceGroupName, String connectionName, String flowName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getStreamConnectionStringSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, accept, context); + } + + /** + * Get the connection string for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection string for the specified flow. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetStreamConnectionStringResultInner getStreamConnectionString(String resourceGroupName, + String connectionName, String flowName) { + return getStreamConnectionStringWithResponse(resourceGroupName, connectionName, flowName, Context.NONE) + .getValue(); + } + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> linkWithResponseAsync(String resourceGroupName, String connectionName, + String flowName, ResourceBody body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.link(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response linkWithResponse(String resourceGroupName, String connectionName, String flowName, + ResourceBody body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.linkSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectionName, flowName, body, accept, Context.NONE); + } + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Flow body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response linkWithResponse(String resourceGroupName, String connectionName, String flowName, + ResourceBody body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.linkSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, connectionName, flowName, body, accept, context); + } + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FlowInner> beginLinkAsync(String resourceGroupName, String connectionName, + String flowName, ResourceBody body) { + Mono>> mono + = linkWithResponseAsync(resourceGroupName, connectionName, flowName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FlowInner.class, + FlowInner.class, this.client.getContext()); + } + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginLink(String resourceGroupName, String connectionName, + String flowName, ResourceBody body) { + Response response = linkWithResponse(resourceGroupName, connectionName, flowName, body); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, Context.NONE); + } + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Flow body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginLink(String resourceGroupName, String connectionName, + String flowName, ResourceBody body, Context context) { + Response response = linkWithResponse(resourceGroupName, connectionName, flowName, body, context); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, context); + } + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono linkAsync(String resourceGroupName, String connectionName, String flowName, + ResourceBody body) { + return beginLinkAsync(resourceGroupName, connectionName, flowName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner link(String resourceGroupName, String connectionName, String flowName, ResourceBody body) { + return beginLink(resourceGroupName, connectionName, flowName, body).getFinalResult(); + } + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Flow body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner link(String resourceGroupName, String connectionName, String flowName, ResourceBody body, + Context context) { + return beginLink(resourceGroupName, connectionName, flowName, body, context).getFinalResult(); + } + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoint ports wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setDestinationEndpointPortsWithResponseAsync(String resourceGroupName, + String connectionName, String flowName, SetDestinationEndpointPorts body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.setDestinationEndpointPorts(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, connectionName, + flowName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoint ports wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response setDestinationEndpointPortsWithResponse(String resourceGroupName, + String connectionName, String flowName, SetDestinationEndpointPorts body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.setDestinationEndpointPortsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, body, accept, Context.NONE); + } + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoint ports wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response setDestinationEndpointPortsWithResponse(String resourceGroupName, + String connectionName, String flowName, SetDestinationEndpointPorts body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.setDestinationEndpointPortsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, body, accept, context); + } + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoint ports wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FlowInner> beginSetDestinationEndpointPortsAsync(String resourceGroupName, + String connectionName, String flowName, SetDestinationEndpointPorts body) { + Mono>> mono + = setDestinationEndpointPortsWithResponseAsync(resourceGroupName, connectionName, flowName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FlowInner.class, + FlowInner.class, this.client.getContext()); + } + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoint ports wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginSetDestinationEndpointPorts(String resourceGroupName, + String connectionName, String flowName, SetDestinationEndpointPorts body) { + Response response + = setDestinationEndpointPortsWithResponse(resourceGroupName, connectionName, flowName, body); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, Context.NONE); + } + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoint ports wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginSetDestinationEndpointPorts(String resourceGroupName, + String connectionName, String flowName, SetDestinationEndpointPorts body, Context context) { + Response response + = setDestinationEndpointPortsWithResponse(resourceGroupName, connectionName, flowName, body, context); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, context); + } + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoint ports wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setDestinationEndpointPortsAsync(String resourceGroupName, String connectionName, + String flowName, SetDestinationEndpointPorts body) { + return beginSetDestinationEndpointPortsAsync(resourceGroupName, connectionName, flowName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoint ports wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner setDestinationEndpointPorts(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpointPorts body) { + return beginSetDestinationEndpointPorts(resourceGroupName, connectionName, flowName, body).getFinalResult(); + } + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoint ports wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner setDestinationEndpointPorts(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpointPorts body, Context context) { + return beginSetDestinationEndpointPorts(resourceGroupName, connectionName, flowName, body, context) + .getFinalResult(); + } + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoints wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setDestinationEndpointsWithResponseAsync(String resourceGroupName, + String connectionName, String flowName, SetDestinationEndpoints body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.setDestinationEndpoints(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, connectionName, + flowName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoints wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response setDestinationEndpointsWithResponse(String resourceGroupName, String connectionName, + String flowName, SetDestinationEndpoints body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.setDestinationEndpointsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, body, accept, Context.NONE); + } + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoints wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response setDestinationEndpointsWithResponse(String resourceGroupName, String connectionName, + String flowName, SetDestinationEndpoints body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.setDestinationEndpointsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, body, accept, context); + } + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoints wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FlowInner> beginSetDestinationEndpointsAsync(String resourceGroupName, + String connectionName, String flowName, SetDestinationEndpoints body) { + Mono>> mono + = setDestinationEndpointsWithResponseAsync(resourceGroupName, connectionName, flowName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FlowInner.class, + FlowInner.class, this.client.getContext()); + } + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoints wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginSetDestinationEndpoints(String resourceGroupName, + String connectionName, String flowName, SetDestinationEndpoints body) { + Response response + = setDestinationEndpointsWithResponse(resourceGroupName, connectionName, flowName, body); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, Context.NONE); + } + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoints wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginSetDestinationEndpoints(String resourceGroupName, + String connectionName, String flowName, SetDestinationEndpoints body, Context context) { + Response response + = setDestinationEndpointsWithResponse(resourceGroupName, connectionName, flowName, body, context); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, context); + } + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoints wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setDestinationEndpointsAsync(String resourceGroupName, String connectionName, + String flowName, SetDestinationEndpoints body) { + return beginSetDestinationEndpointsAsync(resourceGroupName, connectionName, flowName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoints wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner setDestinationEndpoints(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpoints body) { + return beginSetDestinationEndpoints(resourceGroupName, connectionName, flowName, body).getFinalResult(); + } + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoints wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner setDestinationEndpoints(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpoints body, Context context) { + return beginSetDestinationEndpoints(resourceGroupName, connectionName, flowName, body, context) + .getFinalResult(); + } + + /** + * Sets the passphrase of the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Passphrase to set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setPassphraseWithResponseAsync(String resourceGroupName, + String connectionName, String flowName, SetStreamPassphrase body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.setPassphrase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Sets the passphrase of the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Passphrase to set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response setPassphraseWithResponse(String resourceGroupName, String connectionName, + String flowName, SetStreamPassphrase body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.setPassphraseSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, body, accept, Context.NONE); + } + + /** + * Sets the passphrase of the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Passphrase to set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response setPassphraseWithResponse(String resourceGroupName, String connectionName, + String flowName, SetStreamPassphrase body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.setPassphraseSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, body, accept, context); + } + + /** + * Sets the passphrase of the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Passphrase to set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FlowInner> beginSetPassphraseAsync(String resourceGroupName, + String connectionName, String flowName, SetStreamPassphrase body) { + Mono>> mono + = setPassphraseWithResponseAsync(resourceGroupName, connectionName, flowName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FlowInner.class, + FlowInner.class, this.client.getContext()); + } + + /** + * Sets the passphrase of the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Passphrase to set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginSetPassphrase(String resourceGroupName, + String connectionName, String flowName, SetStreamPassphrase body) { + Response response = setPassphraseWithResponse(resourceGroupName, connectionName, flowName, body); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, Context.NONE); + } + + /** + * Sets the passphrase of the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Passphrase to set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginSetPassphrase(String resourceGroupName, + String connectionName, String flowName, SetStreamPassphrase body, Context context) { + Response response + = setPassphraseWithResponse(resourceGroupName, connectionName, flowName, body, context); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, context); + } + + /** + * Sets the passphrase of the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Passphrase to set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setPassphraseAsync(String resourceGroupName, String connectionName, String flowName, + SetStreamPassphrase body) { + return beginSetPassphraseAsync(resourceGroupName, connectionName, flowName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Sets the passphrase of the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Passphrase to set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner setPassphrase(String resourceGroupName, String connectionName, String flowName, + SetStreamPassphrase body) { + return beginSetPassphrase(resourceGroupName, connectionName, flowName, body).getFinalResult(); + } + + /** + * Sets the passphrase of the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Passphrase to set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner setPassphrase(String resourceGroupName, String connectionName, String flowName, + SetStreamPassphrase body, Context context) { + return beginSetPassphrase(resourceGroupName, connectionName, flowName, body, context).getFinalResult(); + } + + /** + * Set the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Source addresses wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setSourceAddressesWithResponseAsync(String resourceGroupName, + String connectionName, String flowName, SetSourceAddresses body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + return Mono.error(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.setSourceAddresses(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Set the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Source addresses wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response setSourceAddressesWithResponse(String resourceGroupName, String connectionName, + String flowName, SetSourceAddresses body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.setSourceAddressesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, body, accept, Context.NONE); + } + + /** + * Set the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Source addresses wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response setSourceAddressesWithResponse(String resourceGroupName, String connectionName, + String flowName, SetSourceAddresses body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (connectionName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); + } + if (flowName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter flowName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.setSourceAddressesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, connectionName, flowName, body, accept, context); + } + + /** + * Set the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Source addresses wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, FlowInner> beginSetSourceAddressesAsync(String resourceGroupName, + String connectionName, String flowName, SetSourceAddresses body) { + Mono>> mono + = setSourceAddressesWithResponseAsync(resourceGroupName, connectionName, flowName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), FlowInner.class, + FlowInner.class, this.client.getContext()); + } + + /** + * Set the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Source addresses wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginSetSourceAddresses(String resourceGroupName, + String connectionName, String flowName, SetSourceAddresses body) { + Response response + = setSourceAddressesWithResponse(resourceGroupName, connectionName, flowName, body); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, Context.NONE); + } + + /** + * Set the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Source addresses wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 flow resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, FlowInner> beginSetSourceAddresses(String resourceGroupName, + String connectionName, String flowName, SetSourceAddresses body, Context context) { + Response response + = setSourceAddressesWithResponse(resourceGroupName, connectionName, flowName, body, context); + return this.client.getLroResult(response, FlowInner.class, FlowInner.class, context); + } + + /** + * Set the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Source addresses wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setSourceAddressesAsync(String resourceGroupName, String connectionName, String flowName, + SetSourceAddresses body) { + return beginSetSourceAddressesAsync(resourceGroupName, connectionName, flowName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Set the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Source addresses wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner setSourceAddresses(String resourceGroupName, String connectionName, String flowName, + SetSourceAddresses body) { + return beginSetSourceAddresses(resourceGroupName, connectionName, flowName, body).getFinalResult(); + } + + /** + * Set the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Source addresses wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FlowInner setSourceAddresses(String resourceGroupName, String connectionName, String flowName, + SetSourceAddresses body, Context context) { + return beginSetSourceAddresses(resourceGroupName, connectionName, flowName, body, context).getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Flow list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByConnectionNextSinglePageAsync(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.listByConnectionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Flow list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByConnectionNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByConnectionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Flow list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByConnectionNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByConnectionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(FlowsClientImpl.class); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowsImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowsImpl.java new file mode 100644 index 000000000000..5f922c5e5580 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/FlowsImpl.java @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.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.azuredatatransfer.fluent.FlowsClient; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.FlowInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.GetDestinationEndpointPortsResultInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.GetDestinationEndpointsResultInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.GetStreamConnectionStringResultInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.StreamSourceAddressesInner; +import com.azure.resourcemanager.azuredatatransfer.models.Flow; +import com.azure.resourcemanager.azuredatatransfer.models.Flows; +import com.azure.resourcemanager.azuredatatransfer.models.GetDestinationEndpointPortsResult; +import com.azure.resourcemanager.azuredatatransfer.models.GetDestinationEndpointsResult; +import com.azure.resourcemanager.azuredatatransfer.models.GetStreamConnectionStringResult; +import com.azure.resourcemanager.azuredatatransfer.models.ResourceBody; +import com.azure.resourcemanager.azuredatatransfer.models.SetDestinationEndpointPorts; +import com.azure.resourcemanager.azuredatatransfer.models.SetDestinationEndpoints; +import com.azure.resourcemanager.azuredatatransfer.models.SetSourceAddresses; +import com.azure.resourcemanager.azuredatatransfer.models.SetStreamPassphrase; +import com.azure.resourcemanager.azuredatatransfer.models.StreamSourceAddresses; + +public final class FlowsImpl implements Flows { + private static final ClientLogger LOGGER = new ClientLogger(FlowsImpl.class); + + private final FlowsClient innerClient; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager; + + public FlowsImpl(FlowsClient innerClient, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByConnection(String resourceGroupName, String connectionName) { + PagedIterable inner = this.serviceClient().listByConnection(resourceGroupName, connectionName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FlowImpl(inner1, this.manager())); + } + + public PagedIterable listByConnection(String resourceGroupName, String connectionName, Context context) { + PagedIterable inner + = this.serviceClient().listByConnection(resourceGroupName, connectionName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FlowImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String connectionName, String flowName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, connectionName, flowName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FlowImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Flow get(String resourceGroupName, String connectionName, String flowName) { + FlowInner inner = this.serviceClient().get(resourceGroupName, connectionName, flowName); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String connectionName, String flowName) { + this.serviceClient().delete(resourceGroupName, connectionName, flowName); + } + + public void delete(String resourceGroupName, String connectionName, String flowName, Context context) { + this.serviceClient().delete(resourceGroupName, connectionName, flowName, context); + } + + public Flow disable(String resourceGroupName, String connectionName, String flowName) { + FlowInner inner = this.serviceClient().disable(resourceGroupName, connectionName, flowName); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow disable(String resourceGroupName, String connectionName, String flowName, Context context) { + FlowInner inner = this.serviceClient().disable(resourceGroupName, connectionName, flowName, context); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow enable(String resourceGroupName, String connectionName, String flowName) { + FlowInner inner = this.serviceClient().enable(resourceGroupName, connectionName, flowName); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow enable(String resourceGroupName, String connectionName, String flowName, Context context) { + FlowInner inner = this.serviceClient().enable(resourceGroupName, connectionName, flowName, context); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow generatePassphrase(String resourceGroupName, String connectionName, String flowName) { + FlowInner inner = this.serviceClient().generatePassphrase(resourceGroupName, connectionName, flowName); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow generatePassphrase(String resourceGroupName, String connectionName, String flowName, Context context) { + FlowInner inner = this.serviceClient().generatePassphrase(resourceGroupName, connectionName, flowName, context); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDestinationEndpointPortsWithResponse(String resourceGroupName, + String connectionName, String flowName, Context context) { + Response inner = this.serviceClient() + .getDestinationEndpointPortsWithResponse(resourceGroupName, connectionName, flowName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GetDestinationEndpointPortsResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetDestinationEndpointPortsResult getDestinationEndpointPorts(String resourceGroupName, + String connectionName, String flowName) { + GetDestinationEndpointPortsResultInner inner + = this.serviceClient().getDestinationEndpointPorts(resourceGroupName, connectionName, flowName); + if (inner != null) { + return new GetDestinationEndpointPortsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDestinationEndpointsWithResponse(String resourceGroupName, + String connectionName, String flowName, Context context) { + Response inner = this.serviceClient() + .getDestinationEndpointsWithResponse(resourceGroupName, connectionName, flowName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GetDestinationEndpointsResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetDestinationEndpointsResult getDestinationEndpoints(String resourceGroupName, String connectionName, + String flowName) { + GetDestinationEndpointsResultInner inner + = this.serviceClient().getDestinationEndpoints(resourceGroupName, connectionName, flowName); + if (inner != null) { + return new GetDestinationEndpointsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSourceAddressesWithResponse(String resourceGroupName, + String connectionName, String flowName, Context context) { + Response inner + = this.serviceClient().getSourceAddressesWithResponse(resourceGroupName, connectionName, flowName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new StreamSourceAddressesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StreamSourceAddresses getSourceAddresses(String resourceGroupName, String connectionName, String flowName) { + StreamSourceAddressesInner inner + = this.serviceClient().getSourceAddresses(resourceGroupName, connectionName, flowName); + if (inner != null) { + return new StreamSourceAddressesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getStreamConnectionStringWithResponse(String resourceGroupName, + String connectionName, String flowName, Context context) { + Response inner = this.serviceClient() + .getStreamConnectionStringWithResponse(resourceGroupName, connectionName, flowName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GetStreamConnectionStringResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetStreamConnectionStringResult getStreamConnectionString(String resourceGroupName, String connectionName, + String flowName) { + GetStreamConnectionStringResultInner inner + = this.serviceClient().getStreamConnectionString(resourceGroupName, connectionName, flowName); + if (inner != null) { + return new GetStreamConnectionStringResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow link(String resourceGroupName, String connectionName, String flowName, ResourceBody body) { + FlowInner inner = this.serviceClient().link(resourceGroupName, connectionName, flowName, body); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow link(String resourceGroupName, String connectionName, String flowName, ResourceBody body, + Context context) { + FlowInner inner = this.serviceClient().link(resourceGroupName, connectionName, flowName, body, context); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setDestinationEndpointPorts(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpointPorts body) { + FlowInner inner + = this.serviceClient().setDestinationEndpointPorts(resourceGroupName, connectionName, flowName, body); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setDestinationEndpointPorts(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpointPorts body, Context context) { + FlowInner inner = this.serviceClient() + .setDestinationEndpointPorts(resourceGroupName, connectionName, flowName, body, context); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setDestinationEndpoints(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpoints body) { + FlowInner inner + = this.serviceClient().setDestinationEndpoints(resourceGroupName, connectionName, flowName, body); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setDestinationEndpoints(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpoints body, Context context) { + FlowInner inner + = this.serviceClient().setDestinationEndpoints(resourceGroupName, connectionName, flowName, body, context); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setPassphrase(String resourceGroupName, String connectionName, String flowName, + SetStreamPassphrase body) { + FlowInner inner = this.serviceClient().setPassphrase(resourceGroupName, connectionName, flowName, body); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setPassphrase(String resourceGroupName, String connectionName, String flowName, + SetStreamPassphrase body, Context context) { + FlowInner inner + = this.serviceClient().setPassphrase(resourceGroupName, connectionName, flowName, body, context); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setSourceAddresses(String resourceGroupName, String connectionName, String flowName, + SetSourceAddresses body) { + FlowInner inner = this.serviceClient().setSourceAddresses(resourceGroupName, connectionName, flowName, body); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow setSourceAddresses(String resourceGroupName, String connectionName, String flowName, + SetSourceAddresses body, Context context) { + FlowInner inner + = this.serviceClient().setSourceAddresses(resourceGroupName, connectionName, flowName, body, context); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Flow getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + String flowName = ResourceManagerUtils.getValueFromIdByName(id, "flows"); + if (flowName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flows'.", id))); + } + return this.getWithResponse(resourceGroupName, connectionName, flowName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + String flowName = ResourceManagerUtils.getValueFromIdByName(id, "flows"); + if (flowName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flows'.", id))); + } + return this.getWithResponse(resourceGroupName, connectionName, flowName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + String flowName = ResourceManagerUtils.getValueFromIdByName(id, "flows"); + if (flowName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flows'.", id))); + } + this.delete(resourceGroupName, connectionName, flowName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + String flowName = ResourceManagerUtils.getValueFromIdByName(id, "flows"); + if (flowName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'flows'.", id))); + } + this.delete(resourceGroupName, connectionName, flowName, context); + } + + private FlowsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } + + public FlowImpl define(String name) { + return new FlowImpl(name, this.manager()); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/GetDestinationEndpointPortsResultImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/GetDestinationEndpointPortsResultImpl.java new file mode 100644 index 000000000000..3bc94e28e6b3 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/GetDestinationEndpointPortsResultImpl.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.azuredatatransfer.implementation; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.GetDestinationEndpointPortsResultInner; +import com.azure.resourcemanager.azuredatatransfer.models.GetDestinationEndpointPortsResult; +import java.util.Collections; +import java.util.List; + +public final class GetDestinationEndpointPortsResultImpl implements GetDestinationEndpointPortsResult { + private GetDestinationEndpointPortsResultInner innerObject; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager; + + GetDestinationEndpointPortsResultImpl(GetDestinationEndpointPortsResultInner innerObject, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List ports() { + List inner = this.innerModel().ports(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public GetDestinationEndpointPortsResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/GetDestinationEndpointsResultImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/GetDestinationEndpointsResultImpl.java new file mode 100644 index 000000000000..c25b4b9adc44 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/GetDestinationEndpointsResultImpl.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.azuredatatransfer.implementation; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.GetDestinationEndpointsResultInner; +import com.azure.resourcemanager.azuredatatransfer.models.GetDestinationEndpointsResult; +import java.util.Collections; +import java.util.List; + +public final class GetDestinationEndpointsResultImpl implements GetDestinationEndpointsResult { + private GetDestinationEndpointsResultInner innerObject; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager; + + GetDestinationEndpointsResultImpl(GetDestinationEndpointsResultInner innerObject, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List endpoints() { + List inner = this.innerModel().endpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public GetDestinationEndpointsResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/GetStreamConnectionStringResultImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/GetStreamConnectionStringResultImpl.java new file mode 100644 index 000000000000..b3d251b9d0c9 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/GetStreamConnectionStringResultImpl.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.azuredatatransfer.implementation; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.GetStreamConnectionStringResultInner; +import com.azure.resourcemanager.azuredatatransfer.models.GetStreamConnectionStringResult; + +public final class GetStreamConnectionStringResultImpl implements GetStreamConnectionStringResult { + private GetStreamConnectionStringResultInner innerObject; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager; + + GetStreamConnectionStringResultImpl(GetStreamConnectionStringResultInner innerObject, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String connectionString() { + return this.innerModel().connectionString(); + } + + public GetStreamConnectionStringResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ListFlowsByPipelineResultImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ListFlowsByPipelineResultImpl.java new file mode 100644 index 000000000000..5ce657195ba1 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ListFlowsByPipelineResultImpl.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.azuredatatransfer.implementation; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ListFlowsByPipelineResultInner; +import com.azure.resourcemanager.azuredatatransfer.models.ListFlowsByPipelineConnection; +import com.azure.resourcemanager.azuredatatransfer.models.ListFlowsByPipelineResult; +import java.util.Collections; +import java.util.List; + +public final class ListFlowsByPipelineResultImpl implements ListFlowsByPipelineResult { + private ListFlowsByPipelineResultInner innerObject; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager; + + ListFlowsByPipelineResultImpl(ListFlowsByPipelineResultInner innerObject, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager 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 ListFlowsByPipelineResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/OperationImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/OperationImpl.java new file mode 100644 index 000000000000..ead89ad30c84 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/OperationImpl.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.azuredatatransfer.implementation; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.OperationInner; +import com.azure.resourcemanager.azuredatatransfer.models.ActionType; +import com.azure.resourcemanager.azuredatatransfer.models.Operation; +import com.azure.resourcemanager.azuredatatransfer.models.OperationDisplay; +import com.azure.resourcemanager.azuredatatransfer.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/OperationsClientImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..53d0fb7ade34 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/OperationsClientImpl.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.azuredatatransfer.fluent.OperationsClient; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.OperationInner; +import com.azure.resourcemanager.azuredatatransfer.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public final class OperationsClientImpl implements OperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationsService service; + + /** + * The service client containing this operation class. + */ + private final AzuredatatransferrpImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(AzuredatatransferrpImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzuredatatransferrpOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzuredatatransferrpO") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AzureDataTransfer/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.AzureDataTransfer/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/OperationsImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/OperationsImpl.java new file mode 100644 index 000000000000..9f6fcff8fba7 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/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.azuredatatransfer.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.azuredatatransfer.fluent.OperationsClient; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.OperationInner; +import com.azure.resourcemanager.azuredatatransfer.models.Operation; +import com.azure.resourcemanager.azuredatatransfer.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.azuredatatransfer.AzuredatatransferManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PendingConnectionImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PendingConnectionImpl.java new file mode 100644 index 000000000000..7100eb3d8bc9 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PendingConnectionImpl.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.azuredatatransfer.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PendingConnectionInner; +import com.azure.resourcemanager.azuredatatransfer.models.Connection; +import com.azure.resourcemanager.azuredatatransfer.models.ConnectionStatus; +import com.azure.resourcemanager.azuredatatransfer.models.Direction; +import com.azure.resourcemanager.azuredatatransfer.models.FlowType; +import com.azure.resourcemanager.azuredatatransfer.models.ForceDisabledStatus; +import com.azure.resourcemanager.azuredatatransfer.models.LinkStatus; +import com.azure.resourcemanager.azuredatatransfer.models.PendingConnection; +import com.azure.resourcemanager.azuredatatransfer.models.ProvisioningState; +import com.azure.resourcemanager.azuredatatransfer.models.Schema; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class PendingConnectionImpl implements PendingConnection { + private PendingConnectionInner innerObject; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager; + + PendingConnectionImpl(PendingConnectionInner innerObject, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String pipeline() { + return this.innerModel().pipeline(); + } + + public Direction direction() { + return this.innerModel().direction(); + } + + public String justification() { + return this.innerModel().justification(); + } + + public ConnectionStatus status() { + return this.innerModel().status(); + } + + public List forceDisabledStatus() { + List inner = this.innerModel().forceDisabledStatus(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String statusReason() { + return this.innerModel().statusReason(); + } + + public LinkStatus linkStatus() { + return this.innerModel().linkStatus(); + } + + public String linkedConnectionId() { + return this.innerModel().linkedConnectionId(); + } + + public List flowTypes() { + List inner = this.innerModel().flowTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String requirementId() { + return this.innerModel().requirementId(); + } + + public String remoteSubscriptionId() { + return this.innerModel().remoteSubscriptionId(); + } + + public String approver() { + return this.innerModel().approver(); + } + + public String pin() { + return this.innerModel().pin(); + } + + public OffsetDateTime dateSubmitted() { + return this.innerModel().dateSubmitted(); + } + + public String primaryContact() { + return this.innerModel().primaryContact(); + } + + public List secondaryContacts() { + List inner = this.innerModel().secondaryContacts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List policies() { + List inner = this.innerModel().policies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List schemas() { + List inner = this.innerModel().schemas(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List schemaUris() { + List inner = this.innerModel().schemaUris(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Connection properties() { + ConnectionInner inner = this.innerModel().properties(); + if (inner != null) { + return new ConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String location() { + return this.innerModel().location(); + } + + 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 subscriptionId() { + return this.innerModel().subscriptionId(); + } + + public PendingConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PendingFlowImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PendingFlowImpl.java new file mode 100644 index 000000000000..973fa291e09a --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PendingFlowImpl.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.FlowInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PendingFlowInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.StreamSourceAddressesInner; +import com.azure.resourcemanager.azuredatatransfer.models.ApiFlowOptions; +import com.azure.resourcemanager.azuredatatransfer.models.DataType; +import com.azure.resourcemanager.azuredatatransfer.models.Flow; +import com.azure.resourcemanager.azuredatatransfer.models.FlowStatus; +import com.azure.resourcemanager.azuredatatransfer.models.FlowType; +import com.azure.resourcemanager.azuredatatransfer.models.ForceDisabledStatus; +import com.azure.resourcemanager.azuredatatransfer.models.LinkStatus; +import com.azure.resourcemanager.azuredatatransfer.models.MessagingOptions; +import com.azure.resourcemanager.azuredatatransfer.models.PendingFlow; +import com.azure.resourcemanager.azuredatatransfer.models.ProvisioningState; +import com.azure.resourcemanager.azuredatatransfer.models.Schema; +import com.azure.resourcemanager.azuredatatransfer.models.SelectedResource; +import com.azure.resourcemanager.azuredatatransfer.models.StreamProtocol; +import com.azure.resourcemanager.azuredatatransfer.models.StreamSourceAddresses; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class PendingFlowImpl implements PendingFlow { + private PendingFlowInner innerObject; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager; + + PendingFlowImpl(PendingFlowInner innerObject, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public SelectedResource connection() { + return this.innerModel().connection(); + } + + public String flowId() { + return this.innerModel().flowId(); + } + + public String keyVaultUri() { + return this.innerModel().keyVaultUri(); + } + + public LinkStatus linkStatus() { + return this.innerModel().linkStatus(); + } + + public String linkedFlowId() { + return this.innerModel().linkedFlowId(); + } + + public FlowStatus status() { + return this.innerModel().status(); + } + + public List forceDisabledStatus() { + List inner = this.innerModel().forceDisabledStatus(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String storageAccountName() { + return this.innerModel().storageAccountName(); + } + + public String storageAccountId() { + return this.innerModel().storageAccountId(); + } + + public String storageContainerName() { + return this.innerModel().storageContainerName(); + } + + public String storageTableName() { + return this.innerModel().storageTableName(); + } + + public String serviceBusQueueId() { + return this.innerModel().serviceBusQueueId(); + } + + public FlowType flowType() { + return this.innerModel().flowType(); + } + + public DataType dataType() { + return this.innerModel().dataType(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public List policies() { + List inner = this.innerModel().policies(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Schema schema() { + return this.innerModel().schema(); + } + + public MessagingOptions messagingOptions() { + return this.innerModel().messagingOptions(); + } + + public ApiFlowOptions apiFlowOptions() { + return this.innerModel().apiFlowOptions(); + } + + public String customerManagedKeyVaultUri() { + return this.innerModel().customerManagedKeyVaultUri(); + } + + public String streamId() { + return this.innerModel().streamId(); + } + + public StreamProtocol streamProtocol() { + return this.innerModel().streamProtocol(); + } + + public Long streamLatency() { + return this.innerModel().streamLatency(); + } + + public String passphrase() { + return this.innerModel().passphrase(); + } + + public StreamSourceAddresses sourceAddresses() { + StreamSourceAddressesInner inner = this.innerModel().sourceAddresses(); + if (inner != null) { + return new StreamSourceAddressesImpl(inner, this.manager()); + } else { + return null; + } + } + + public List destinationEndpoints() { + List inner = this.innerModel().destinationEndpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List destinationEndpointPorts() { + List inner = this.innerModel().destinationEndpointPorts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String eventHubId() { + return this.innerModel().eventHubId(); + } + + public String consumerGroup() { + return this.innerModel().consumerGroup(); + } + + public Flow properties() { + FlowInner inner = this.innerModel().properties(); + if (inner != null) { + return new FlowImpl(inner, this.manager()); + } else { + return null; + } + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String location() { + return this.innerModel().location(); + } + + 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 subscriptionId() { + return this.innerModel().subscriptionId(); + } + + public String connectionId() { + return this.innerModel().connectionId(); + } + + public PendingFlowInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PipelineImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PipelineImpl.java new file mode 100644 index 000000000000..b095eda4a7b9 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PipelineImpl.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PipelineInner; +import com.azure.resourcemanager.azuredatatransfer.models.Action; +import com.azure.resourcemanager.azuredatatransfer.models.Connection; +import com.azure.resourcemanager.azuredatatransfer.models.ConnectionIdList; +import com.azure.resourcemanager.azuredatatransfer.models.ListFlowsByPipelineResult; +import com.azure.resourcemanager.azuredatatransfer.models.ManagedServiceIdentity; +import com.azure.resourcemanager.azuredatatransfer.models.Pipeline; +import com.azure.resourcemanager.azuredatatransfer.models.PipelineProperties; +import com.azure.resourcemanager.azuredatatransfer.models.PipelinesPatch; +import com.azure.resourcemanager.azuredatatransfer.models.PipelinesPatchProperties; +import com.azure.resourcemanager.azuredatatransfer.models.ResourceBody; +import com.azure.resourcemanager.azuredatatransfer.models.Schema; +import com.azure.resourcemanager.azuredatatransfer.models.SchemasListResult; +import java.util.Collections; +import java.util.Map; + +public final class PipelineImpl implements Pipeline, Pipeline.Definition, Pipeline.Update { + private PipelineInner innerObject; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager 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 PipelineProperties properties() { + return this.innerModel().properties(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PipelineInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String pipelineName; + + private PipelinesPatch updateProperties; + + public PipelineImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Pipeline create() { + this.innerObject = serviceManager.serviceClient() + .getPipelines() + .createOrUpdate(resourceGroupName, pipelineName, this.innerModel(), Context.NONE); + return this; + } + + public Pipeline create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPipelines() + .createOrUpdate(resourceGroupName, pipelineName, this.innerModel(), context); + return this; + } + + PipelineImpl(String name, com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerObject = new PipelineInner(); + this.serviceManager = serviceManager; + this.pipelineName = name; + } + + public PipelineImpl update() { + this.updateProperties = new PipelinesPatch(); + return this; + } + + public Pipeline apply() { + this.innerObject = serviceManager.serviceClient() + .getPipelines() + .update(resourceGroupName, pipelineName, updateProperties, Context.NONE); + return this; + } + + public Pipeline apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPipelines() + .update(resourceGroupName, pipelineName, updateProperties, context); + return this; + } + + PipelineImpl(PipelineInner innerObject, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.pipelineName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "pipelines"); + } + + public Pipeline refresh() { + this.innerObject = serviceManager.serviceClient() + .getPipelines() + .getByResourceGroupWithResponse(resourceGroupName, pipelineName, Context.NONE) + .getValue(); + return this; + } + + public Pipeline refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPipelines() + .getByResourceGroupWithResponse(resourceGroupName, pipelineName, context) + .getValue(); + return this; + } + + public Connection approveConnection(ResourceBody body) { + return serviceManager.pipelines().approveConnection(resourceGroupName, pipelineName, body); + } + + public Connection approveConnection(ResourceBody body, Context context) { + return serviceManager.pipelines().approveConnection(resourceGroupName, pipelineName, body, context); + } + + public Pipeline executeAction(Action body) { + return serviceManager.pipelines().executeAction(resourceGroupName, pipelineName, body); + } + + public Pipeline executeAction(Action body, Context context) { + return serviceManager.pipelines().executeAction(resourceGroupName, pipelineName, body, context); + } + + public Response listWithResponse(ConnectionIdList connections, Context context) { + return serviceManager.pipelines().listWithResponse(resourceGroupName, pipelineName, connections, context); + } + + public ListFlowsByPipelineResult list() { + return serviceManager.pipelines().list(resourceGroupName, pipelineName); + } + + public Response listSchemasListWithResponse(Schema body, Context context) { + return serviceManager.pipelines().listSchemasListWithResponse(resourceGroupName, pipelineName, body, context); + } + + public SchemasListResult listSchemasList(Schema body) { + return serviceManager.pipelines().listSchemasList(resourceGroupName, pipelineName, body); + } + + public Connection rejectConnection(ResourceBody body) { + return serviceManager.pipelines().rejectConnection(resourceGroupName, pipelineName, body); + } + + public Connection rejectConnection(ResourceBody body, Context context) { + return serviceManager.pipelines().rejectConnection(resourceGroupName, pipelineName, body, context); + } + + public PipelineImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PipelineImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PipelineImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public PipelineImpl withProperties(PipelineProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public PipelineImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateProperties.withIdentity(identity); + return this; + } + } + + public PipelineImpl withProperties(PipelinesPatchProperties properties) { + this.updateProperties.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PipelinesClientImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PipelinesClientImpl.java new file mode 100644 index 000000000000..3ab708c64c69 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PipelinesClientImpl.java @@ -0,0 +1,2468 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.azuredatatransfer.fluent.PipelinesClient; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ListFlowsByPipelineResultInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PipelineInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.SchemasListResultInner; +import com.azure.resourcemanager.azuredatatransfer.models.Action; +import com.azure.resourcemanager.azuredatatransfer.models.ConnectionIdList; +import com.azure.resourcemanager.azuredatatransfer.models.PipelineListResult; +import com.azure.resourcemanager.azuredatatransfer.models.PipelinesPatch; +import com.azure.resourcemanager.azuredatatransfer.models.ResourceBody; +import com.azure.resourcemanager.azuredatatransfer.models.Schema; +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 PipelinesClient. + */ +public final class PipelinesClientImpl implements PipelinesClient { + /** + * The proxy service used to perform REST calls. + */ + private final PipelinesService service; + + /** + * The service client containing this operation class. + */ + private final AzuredatatransferrpImpl client; + + /** + * Initializes an instance of PipelinesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PipelinesClientImpl(AzuredatatransferrpImpl client) { + this.service + = RestProxy.create(PipelinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzuredatatransferrpPipelines to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzuredatatransferrpP") + public interface PipelinesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureDataTransfer/pipelines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscription(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureDataTransfer/pipelines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @BodyParam("application/json") PipelineInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @BodyParam("application/json") PipelineInner resource, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @BodyParam("application/json") PipelinesPatch properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @BodyParam("application/json") PipelinesPatch properties, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/approveConnection") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> approveConnection(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @BodyParam("application/json") ResourceBody body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/approveConnection") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response approveConnectionSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @BodyParam("application/json") ResourceBody body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/executeAction") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> executeAction(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @BodyParam("application/json") Action body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/executeAction") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response executeActionSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @BodyParam("application/json") Action body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/listFlows") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @BodyParam("application/json") ConnectionIdList connections, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/listFlows") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @BodyParam("application/json") ConnectionIdList connections, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/listSchemas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSchemasList(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @BodyParam("application/json") Schema body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/listSchemas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSchemasListSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @BodyParam("application/json") Schema body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/rejectConnection") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> rejectConnection(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @BodyParam("application/json") ResourceBody body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureDataTransfer/pipelines/{pipelineName}/rejectConnection") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response rejectConnectionSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("pipelineName") String pipelineName, + @BodyParam("application/json") ResourceBody body, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets pipelines in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a subscription along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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.listBySubscription(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets pipelines in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync() { + return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets pipelines in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listBySubscriptionSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets pipelines in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listBySubscriptionSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets pipelines in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription() { + return new PagedIterable<>(() -> listBySubscriptionSinglePage(), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * Gets pipelines in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription(Context context) { + return new PagedIterable<>(() -> listBySubscriptionSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * Gets pipelines in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a resource group along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets pipelines in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets pipelines in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets pipelines in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets pipelines in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * Gets pipelines in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * Gets pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipeline resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String pipelineName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + return Mono.error(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipeline resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String pipelineName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, pipelineName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipeline resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String pipelineName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, accept, context); + } + + /** + * Gets pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipeline resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PipelineInner getByResourceGroup(String resourceGroupName, String pipelineName) { + return getByResourceGroupWithResponse(resourceGroupName, pipelineName, Context.NONE).getValue(); + } + + /** + * Creates or updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param resource Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String pipelineName, PipelineInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + return Mono.error(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param resource Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String pipelineName, + PipelineInner resource) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (resource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, resource, accept, Context.NONE); + } + + /** + * Creates or updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param resource Pipeline body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String pipelineName, + PipelineInner resource, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (resource == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, resource, accept, context); + } + + /** + * Creates or updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param resource Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PipelineInner> beginCreateOrUpdateAsync(String resourceGroupName, + String pipelineName, PipelineInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, pipelineName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + PipelineInner.class, PipelineInner.class, this.client.getContext()); + } + + /** + * Creates or updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param resource Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PipelineInner> beginCreateOrUpdate(String resourceGroupName, + String pipelineName, PipelineInner resource) { + Response response = createOrUpdateWithResponse(resourceGroupName, pipelineName, resource); + return this.client.getLroResult(response, PipelineInner.class, + PipelineInner.class, Context.NONE); + } + + /** + * Creates or updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param resource Pipeline body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PipelineInner> beginCreateOrUpdate(String resourceGroupName, + String pipelineName, PipelineInner resource, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, pipelineName, resource, context); + return this.client.getLroResult(response, PipelineInner.class, + PipelineInner.class, context); + } + + /** + * Creates or updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param resource Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String pipelineName, + PipelineInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, pipelineName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param resource Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PipelineInner createOrUpdate(String resourceGroupName, String pipelineName, PipelineInner resource) { + return beginCreateOrUpdate(resourceGroupName, pipelineName, resource).getFinalResult(); + } + + /** + * Creates or updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param resource Pipeline body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PipelineInner createOrUpdate(String resourceGroupName, String pipelineName, PipelineInner resource, + Context context) { + return beginCreateOrUpdate(resourceGroupName, pipelineName, resource, context).getFinalResult(); + } + + /** + * Updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param properties Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String pipelineName, + PipelinesPatch properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + return Mono.error(new IllegalArgumentException("Parameter pipelineName 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.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param properties Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String pipelineName, + PipelinesPatch properties) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (properties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, properties, accept, Context.NONE); + } + + /** + * Updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param properties Pipeline body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String pipelineName, + PipelinesPatch properties, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (properties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, properties, accept, context); + } + + /** + * Updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param properties Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PipelineInner> beginUpdateAsync(String resourceGroupName, + String pipelineName, PipelinesPatch properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, pipelineName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + PipelineInner.class, PipelineInner.class, this.client.getContext()); + } + + /** + * Updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param properties Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PipelineInner> beginUpdate(String resourceGroupName, + String pipelineName, PipelinesPatch properties) { + Response response = updateWithResponse(resourceGroupName, pipelineName, properties); + return this.client.getLroResult(response, PipelineInner.class, + PipelineInner.class, Context.NONE); + } + + /** + * Updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param properties Pipeline body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PipelineInner> beginUpdate(String resourceGroupName, + String pipelineName, PipelinesPatch properties, Context context) { + Response response = updateWithResponse(resourceGroupName, pipelineName, properties, context); + return this.client.getLroResult(response, PipelineInner.class, + PipelineInner.class, context); + } + + /** + * Updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param properties Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String pipelineName, PipelinesPatch properties) { + return beginUpdateAsync(resourceGroupName, pipelineName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param properties Pipeline body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PipelineInner update(String resourceGroupName, String pipelineName, PipelinesPatch properties) { + return beginUpdate(resourceGroupName, pipelineName, properties).getFinalResult(); + } + + /** + * Updates the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param properties Pipeline body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PipelineInner update(String resourceGroupName, String pipelineName, PipelinesPatch properties, + Context context) { + return beginUpdate(resourceGroupName, pipelineName, properties, context).getFinalResult(); + } + + /** + * Deletes the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 pipelineName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + return Mono.error(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String pipelineName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, accept, Context.NONE); + } + + /** + * Deletes the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String pipelineName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, accept, context); + } + + /** + * Deletes the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 pipelineName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, pipelineName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 pipelineName) { + Response response = deleteWithResponse(resourceGroupName, pipelineName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 pipelineName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, pipelineName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String pipelineName) { + return beginDeleteAsync(resourceGroupName, pipelineName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String pipelineName) { + beginDelete(resourceGroupName, pipelineName).getFinalResult(); + } + + /** + * Deletes the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String pipelineName, Context context) { + beginDelete(resourceGroupName, pipelineName, context).getFinalResult(); + } + + /** + * Approves the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> approveConnectionWithResponseAsync(String resourceGroupName, + String pipelineName, ResourceBody body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + return Mono.error(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.approveConnection(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Approves the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response approveConnectionWithResponse(String resourceGroupName, String pipelineName, + ResourceBody body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.approveConnectionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, body, accept, Context.NONE); + } + + /** + * Approves the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response approveConnectionWithResponse(String resourceGroupName, String pipelineName, + ResourceBody body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.approveConnectionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, body, accept, context); + } + + /** + * Approves the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConnectionInner> + beginApproveConnectionAsync(String resourceGroupName, String pipelineName, ResourceBody body) { + Mono>> mono + = approveConnectionWithResponseAsync(resourceGroupName, pipelineName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ConnectionInner.class, ConnectionInner.class, this.client.getContext()); + } + + /** + * Approves the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionInner> beginApproveConnection(String resourceGroupName, + String pipelineName, ResourceBody body) { + Response response = approveConnectionWithResponse(resourceGroupName, pipelineName, body); + return this.client.getLroResult(response, ConnectionInner.class, + ConnectionInner.class, Context.NONE); + } + + /** + * Approves the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionInner> beginApproveConnection(String resourceGroupName, + String pipelineName, ResourceBody body, Context context) { + Response response = approveConnectionWithResponse(resourceGroupName, pipelineName, body, context); + return this.client.getLroResult(response, ConnectionInner.class, + ConnectionInner.class, context); + } + + /** + * Approves the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono approveConnectionAsync(String resourceGroupName, String pipelineName, + ResourceBody body) { + return beginApproveConnectionAsync(resourceGroupName, pipelineName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approves the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionInner approveConnection(String resourceGroupName, String pipelineName, ResourceBody body) { + return beginApproveConnection(resourceGroupName, pipelineName, body).getFinalResult(); + } + + /** + * Approves the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionInner approveConnection(String resourceGroupName, String pipelineName, ResourceBody body, + Context context) { + return beginApproveConnection(resourceGroupName, pipelineName, body, context).getFinalResult(); + } + + /** + * Executes a privileged action for a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Action to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> executeActionWithResponseAsync(String resourceGroupName, + String pipelineName, Action body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + return Mono.error(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.executeAction(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Executes a privileged action for a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Action to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response executeActionWithResponse(String resourceGroupName, String pipelineName, Action body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.executeActionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, body, accept, Context.NONE); + } + + /** + * Executes a privileged action for a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Action to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response executeActionWithResponse(String resourceGroupName, String pipelineName, Action body, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.executeActionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, body, accept, context); + } + + /** + * Executes a privileged action for a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Action to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PipelineInner> beginExecuteActionAsync(String resourceGroupName, + String pipelineName, Action body) { + Mono>> mono = executeActionWithResponseAsync(resourceGroupName, pipelineName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + PipelineInner.class, PipelineInner.class, this.client.getContext()); + } + + /** + * Executes a privileged action for a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Action to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PipelineInner> beginExecuteAction(String resourceGroupName, + String pipelineName, Action body) { + Response response = executeActionWithResponse(resourceGroupName, pipelineName, body); + return this.client.getLroResult(response, PipelineInner.class, + PipelineInner.class, Context.NONE); + } + + /** + * Executes a privileged action for a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Action to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PipelineInner> beginExecuteAction(String resourceGroupName, + String pipelineName, Action body, Context context) { + Response response = executeActionWithResponse(resourceGroupName, pipelineName, body, context); + return this.client.getLroResult(response, PipelineInner.class, + PipelineInner.class, context); + } + + /** + * Executes a privileged action for a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Action to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono executeActionAsync(String resourceGroupName, String pipelineName, Action body) { + return beginExecuteActionAsync(resourceGroupName, pipelineName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes a privileged action for a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Action to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PipelineInner executeAction(String resourceGroupName, String pipelineName, Action body) { + return beginExecuteAction(resourceGroupName, pipelineName, body).getFinalResult(); + } + + /** + * Executes a privileged action for a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Action to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PipelineInner executeAction(String resourceGroupName, String pipelineName, Action body, Context context) { + return beginExecuteAction(resourceGroupName, pipelineName, body, context).getFinalResult(); + } + + /** + * Lists the flows in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param connections Connection(s) to retrieve flows of. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of flow resources along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String pipelineName, ConnectionIdList connections) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + return Mono.error(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (connections != null) { + connections.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, connections, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the flows in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of flow resources on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String pipelineName) { + final ConnectionIdList connections = null; + return listWithResponseAsync(resourceGroupName, pipelineName, connections) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists the flows in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param connections Connection(s) to retrieve flows of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of flow resources along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, String pipelineName, + ConnectionIdList connections, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (connections != null) { + connections.validate(); + } + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, pipelineName, connections, accept, context); + } + + /** + * Lists the flows in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of flow resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ListFlowsByPipelineResultInner list(String resourceGroupName, String pipelineName) { + final ConnectionIdList connections = null; + return listWithResponse(resourceGroupName, pipelineName, connections, Context.NONE).getValue(); + } + + /** + * Lists the schemas for the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Schema(s) to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSchemasListWithResponseAsync(String resourceGroupName, + String pipelineName, Schema body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + return Mono.error(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSchemasList(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the schemas for the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Schema(s) to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSchemasListAsync(String resourceGroupName, String pipelineName, + Schema body) { + return listSchemasListWithResponseAsync(resourceGroupName, pipelineName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists the schemas for the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Schema(s) to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSchemasListWithResponse(String resourceGroupName, String pipelineName, + Schema body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.listSchemasListSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, body, accept, context); + } + + /** + * Lists the schemas for the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Schema(s) to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SchemasListResultInner listSchemasList(String resourceGroupName, String pipelineName, Schema body) { + return listSchemasListWithResponse(resourceGroupName, pipelineName, body, Context.NONE).getValue(); + } + + /** + * Rejects the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rejectConnectionWithResponseAsync(String resourceGroupName, + String pipelineName, ResourceBody body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + return Mono.error(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.rejectConnection(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Rejects the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response rejectConnectionWithResponse(String resourceGroupName, String pipelineName, + ResourceBody body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.rejectConnectionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, body, accept, Context.NONE); + } + + /** + * Rejects the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response rejectConnectionWithResponse(String resourceGroupName, String pipelineName, + ResourceBody body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (pipelineName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter pipelineName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.rejectConnectionSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, pipelineName, body, accept, context); + } + + /** + * Rejects the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConnectionInner> + beginRejectConnectionAsync(String resourceGroupName, String pipelineName, ResourceBody body) { + Mono>> mono + = rejectConnectionWithResponseAsync(resourceGroupName, pipelineName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ConnectionInner.class, ConnectionInner.class, this.client.getContext()); + } + + /** + * Rejects the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionInner> beginRejectConnection(String resourceGroupName, + String pipelineName, ResourceBody body) { + Response response = rejectConnectionWithResponse(resourceGroupName, pipelineName, body); + return this.client.getLroResult(response, ConnectionInner.class, + ConnectionInner.class, Context.NONE); + } + + /** + * Rejects the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConnectionInner> beginRejectConnection(String resourceGroupName, + String pipelineName, ResourceBody body, Context context) { + Response response = rejectConnectionWithResponse(resourceGroupName, pipelineName, body, context); + return this.client.getLroResult(response, ConnectionInner.class, + ConnectionInner.class, context); + } + + /** + * Rejects the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rejectConnectionAsync(String resourceGroupName, String pipelineName, + ResourceBody body) { + return beginRejectConnectionAsync(resourceGroupName, pipelineName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rejects the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionInner rejectConnection(String resourceGroupName, String pipelineName, ResourceBody body) { + return beginRejectConnection(resourceGroupName, pipelineName, body).getFinalResult(); + } + + /** + * Rejects the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionInner rejectConnection(String resourceGroupName, String pipelineName, ResourceBody body, + Context context) { + return beginRejectConnection(resourceGroupName, pipelineName, body, context).getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a Pipeline list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(PipelinesClientImpl.class); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PipelinesImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PipelinesImpl.java new file mode 100644 index 000000000000..396257e6b990 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/PipelinesImpl.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.azuredatatransfer.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.azuredatatransfer.fluent.PipelinesClient; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ConnectionInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ListFlowsByPipelineResultInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PipelineInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.SchemasListResultInner; +import com.azure.resourcemanager.azuredatatransfer.models.Action; +import com.azure.resourcemanager.azuredatatransfer.models.Connection; +import com.azure.resourcemanager.azuredatatransfer.models.ConnectionIdList; +import com.azure.resourcemanager.azuredatatransfer.models.ListFlowsByPipelineResult; +import com.azure.resourcemanager.azuredatatransfer.models.Pipeline; +import com.azure.resourcemanager.azuredatatransfer.models.Pipelines; +import com.azure.resourcemanager.azuredatatransfer.models.ResourceBody; +import com.azure.resourcemanager.azuredatatransfer.models.Schema; +import com.azure.resourcemanager.azuredatatransfer.models.SchemasListResult; + +public final class PipelinesImpl implements Pipelines { + private static final ClientLogger LOGGER = new ClientLogger(PipelinesImpl.class); + + private final PipelinesClient innerClient; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager; + + public PipelinesImpl(PipelinesClient innerClient, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listBySubscription() { + PagedIterable inner = this.serviceClient().listBySubscription(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PipelineImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscription(Context context) { + PagedIterable inner = this.serviceClient().listBySubscription(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PipelineImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PipelineImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PipelineImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String pipelineName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, pipelineName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PipelineImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Pipeline getByResourceGroup(String resourceGroupName, String pipelineName) { + PipelineInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, pipelineName); + if (inner != null) { + return new PipelineImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String pipelineName) { + this.serviceClient().delete(resourceGroupName, pipelineName); + } + + public void delete(String resourceGroupName, String pipelineName, Context context) { + this.serviceClient().delete(resourceGroupName, pipelineName, context); + } + + public Connection approveConnection(String resourceGroupName, String pipelineName, ResourceBody body) { + ConnectionInner inner = this.serviceClient().approveConnection(resourceGroupName, pipelineName, body); + if (inner != null) { + return new ConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Connection approveConnection(String resourceGroupName, String pipelineName, ResourceBody body, + Context context) { + ConnectionInner inner = this.serviceClient().approveConnection(resourceGroupName, pipelineName, body, context); + if (inner != null) { + return new ConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Pipeline executeAction(String resourceGroupName, String pipelineName, Action body) { + PipelineInner inner = this.serviceClient().executeAction(resourceGroupName, pipelineName, body); + if (inner != null) { + return new PipelineImpl(inner, this.manager()); + } else { + return null; + } + } + + public Pipeline executeAction(String resourceGroupName, String pipelineName, Action body, Context context) { + PipelineInner inner = this.serviceClient().executeAction(resourceGroupName, pipelineName, body, context); + if (inner != null) { + return new PipelineImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse(String resourceGroupName, String pipelineName, + ConnectionIdList connections, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, pipelineName, connections, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ListFlowsByPipelineResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ListFlowsByPipelineResult list(String resourceGroupName, String pipelineName) { + ListFlowsByPipelineResultInner inner = this.serviceClient().list(resourceGroupName, pipelineName); + if (inner != null) { + return new ListFlowsByPipelineResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listSchemasListWithResponse(String resourceGroupName, String pipelineName, + Schema body, Context context) { + Response inner + = this.serviceClient().listSchemasListWithResponse(resourceGroupName, pipelineName, body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SchemasListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SchemasListResult listSchemasList(String resourceGroupName, String pipelineName, Schema body) { + SchemasListResultInner inner = this.serviceClient().listSchemasList(resourceGroupName, pipelineName, body); + if (inner != null) { + return new SchemasListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Connection rejectConnection(String resourceGroupName, String pipelineName, ResourceBody body) { + ConnectionInner inner = this.serviceClient().rejectConnection(resourceGroupName, pipelineName, body); + if (inner != null) { + return new ConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Connection rejectConnection(String resourceGroupName, String pipelineName, ResourceBody body, + Context context) { + ConnectionInner inner = this.serviceClient().rejectConnection(resourceGroupName, pipelineName, body, context); + if (inner != null) { + return new ConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Pipeline getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String pipelineName = ResourceManagerUtils.getValueFromIdByName(id, "pipelines"); + if (pipelineName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pipelines'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, pipelineName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String pipelineName = ResourceManagerUtils.getValueFromIdByName(id, "pipelines"); + if (pipelineName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pipelines'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, pipelineName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String pipelineName = ResourceManagerUtils.getValueFromIdByName(id, "pipelines"); + if (pipelineName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pipelines'.", id))); + } + this.delete(resourceGroupName, pipelineName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String pipelineName = ResourceManagerUtils.getValueFromIdByName(id, "pipelines"); + if (pipelineName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'pipelines'.", id))); + } + this.delete(resourceGroupName, pipelineName, context); + } + + private PipelinesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } + + public PipelineImpl define(String name) { + return new PipelineImpl(name, this.manager()); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ResourceManagerUtils.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..ee9d9817d464 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/SchemasListResultImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/SchemasListResultImpl.java new file mode 100644 index 000000000000..1c2454b6558a --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/SchemasListResultImpl.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.azuredatatransfer.implementation; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.SchemasListResultInner; +import com.azure.resourcemanager.azuredatatransfer.models.Schema; +import com.azure.resourcemanager.azuredatatransfer.models.SchemasListResult; +import java.util.Collections; +import java.util.List; + +public final class SchemasListResultImpl implements SchemasListResult { + private SchemasListResultInner innerObject; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager; + + SchemasListResultImpl(SchemasListResultInner innerObject, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager 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 SchemasListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/StreamSourceAddressesImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/StreamSourceAddressesImpl.java new file mode 100644 index 000000000000..aa266338dcbb --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/StreamSourceAddressesImpl.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.azuredatatransfer.implementation; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.StreamSourceAddressesInner; +import com.azure.resourcemanager.azuredatatransfer.models.StreamSourceAddresses; +import java.util.Collections; +import java.util.List; + +public final class StreamSourceAddressesImpl implements StreamSourceAddresses { + private StreamSourceAddressesInner innerObject; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager; + + StreamSourceAddressesImpl(StreamSourceAddressesInner innerObject, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List sourceAddresses() { + List inner = this.innerModel().sourceAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public StreamSourceAddressesInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ValidateSchemaResultImpl.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ValidateSchemaResultImpl.java new file mode 100644 index 000000000000..cad9593c35ac --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/ValidateSchemaResultImpl.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.azuredatatransfer.implementation; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ValidateSchemaResultInner; +import com.azure.resourcemanager.azuredatatransfer.models.ValidateSchemaResult; +import com.azure.resourcemanager.azuredatatransfer.models.ValidateSchemaStatus; + +public final class ValidateSchemaResultImpl implements ValidateSchemaResult { + private ValidateSchemaResultInner innerObject; + + private final com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager; + + ValidateSchemaResultImpl(ValidateSchemaResultInner innerObject, + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ValidateSchemaStatus status() { + return this.innerModel().status(); + } + + public String message() { + return this.innerModel().message(); + } + + public ValidateSchemaResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/package-info.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/package-info.java new file mode 100644 index 000000000000..5d4890b0a3d7 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for Azuredatatransferrp. + * Azure Data Transfer service resource provider. + */ +package com.azure.resourcemanager.azuredatatransfer.implementation; diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Action.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Action.java new file mode 100644 index 000000000000..9ae261ed3ca3 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Action.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The action to be executed. + */ +@Fluent +public final class Action implements JsonSerializable { + /* + * Type of action to be executed + */ + private ActionType actionType; + + /* + * Type of target to execute the action on + */ + private TargetType targetType; + + /* + * Targets for the action + */ + private List targets; + + /* + * Business justification for the action + */ + private String justification; + + /** + * Creates an instance of Action class. + */ + public Action() { + } + + /** + * Get the actionType property: Type of action to be executed. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Set the actionType property: Type of action to be executed. + * + * @param actionType the actionType value to set. + * @return the Action object itself. + */ + public Action withActionType(ActionType actionType) { + this.actionType = actionType; + return this; + } + + /** + * Get the targetType property: Type of target to execute the action on. + * + * @return the targetType value. + */ + public TargetType targetType() { + return this.targetType; + } + + /** + * Set the targetType property: Type of target to execute the action on. + * + * @param targetType the targetType value to set. + * @return the Action object itself. + */ + public Action withTargetType(TargetType targetType) { + this.targetType = targetType; + return this; + } + + /** + * Get the targets property: Targets for the action. + * + * @return the targets value. + */ + public List targets() { + return this.targets; + } + + /** + * Set the targets property: Targets for the action. + * + * @param targets the targets value to set. + * @return the Action object itself. + */ + public Action withTargets(List targets) { + this.targets = targets; + return this; + } + + /** + * Get the justification property: Business justification for the action. + * + * @return the justification value. + */ + public String justification() { + return this.justification; + } + + /** + * Set the justification property: Business justification for the action. + * + * @param justification the justification value to set. + * @return the Action object itself. + */ + public Action withJustification(String justification) { + this.justification = justification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actionType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property actionType in model Action")); + } + if (targetType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property targetType in model Action")); + } + if (targets() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property targets in model Action")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Action.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); + jsonWriter.writeStringField("targetType", this.targetType == null ? null : this.targetType.toString()); + jsonWriter.writeArrayField("targets", this.targets, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("justification", this.justification); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Action from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Action if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Action. + */ + public static Action fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Action deserializedAction = new Action(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actionType".equals(fieldName)) { + deserializedAction.actionType = ActionType.fromString(reader.getString()); + } else if ("targetType".equals(fieldName)) { + deserializedAction.targetType = TargetType.fromString(reader.getString()); + } else if ("targets".equals(fieldName)) { + List targets = reader.readArray(reader1 -> reader1.getString()); + deserializedAction.targets = targets; + } else if ("justification".equals(fieldName)) { + deserializedAction.justification = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAction; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ActionType.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ActionType.java new file mode 100644 index 000000000000..22b3baf51af2 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ActionType.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Static value Internal for ActionType. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ApiFlowOptions.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ApiFlowOptions.java new file mode 100644 index 000000000000..6d607612dba8 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ApiFlowOptions.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties specific to API Flow Type. + */ +@Fluent +public final class ApiFlowOptions implements JsonSerializable { + /* + * Remote host to which communication needs to be made + */ + private String remoteEndpoint; + + /* + * Unique CNAME to represent the Azure Data Transfer API Flow instance + */ + private String cname; + + /* + * Remote Calling Mode in the Azure Data Transfer API Flow, which describes how the API Flow will be invoked + */ + private ApiMode apiMode; + + /* + * Flag for if Azure Data Transfer API Flow should extract the user token + */ + private IdentityTranslation identityTranslation; + + /* + * Sender's app user assigned Manage Identity client ID + */ + private String senderClientId; + + /* + * Remote stub app registration Client ID + */ + private String remoteCallingModeClientId; + + /* + * Optional field to override the audience of the remote endpoint + */ + private String audienceOverride; + + /** + * Creates an instance of ApiFlowOptions class. + */ + public ApiFlowOptions() { + } + + /** + * Get the remoteEndpoint property: Remote host to which communication needs to be made. + * + * @return the remoteEndpoint value. + */ + public String remoteEndpoint() { + return this.remoteEndpoint; + } + + /** + * Set the remoteEndpoint property: Remote host to which communication needs to be made. + * + * @param remoteEndpoint the remoteEndpoint value to set. + * @return the ApiFlowOptions object itself. + */ + public ApiFlowOptions withRemoteEndpoint(String remoteEndpoint) { + this.remoteEndpoint = remoteEndpoint; + return this; + } + + /** + * Get the cname property: Unique CNAME to represent the Azure Data Transfer API Flow instance. + * + * @return the cname value. + */ + public String cname() { + return this.cname; + } + + /** + * Set the cname property: Unique CNAME to represent the Azure Data Transfer API Flow instance. + * + * @param cname the cname value to set. + * @return the ApiFlowOptions object itself. + */ + public ApiFlowOptions withCname(String cname) { + this.cname = cname; + return this; + } + + /** + * Get the apiMode property: Remote Calling Mode in the Azure Data Transfer API Flow, which describes how the API + * Flow will be invoked. + * + * @return the apiMode value. + */ + public ApiMode apiMode() { + return this.apiMode; + } + + /** + * Set the apiMode property: Remote Calling Mode in the Azure Data Transfer API Flow, which describes how the API + * Flow will be invoked. + * + * @param apiMode the apiMode value to set. + * @return the ApiFlowOptions object itself. + */ + public ApiFlowOptions withApiMode(ApiMode apiMode) { + this.apiMode = apiMode; + return this; + } + + /** + * Get the identityTranslation property: Flag for if Azure Data Transfer API Flow should extract the user token. + * + * @return the identityTranslation value. + */ + public IdentityTranslation identityTranslation() { + return this.identityTranslation; + } + + /** + * Set the identityTranslation property: Flag for if Azure Data Transfer API Flow should extract the user token. + * + * @param identityTranslation the identityTranslation value to set. + * @return the ApiFlowOptions object itself. + */ + public ApiFlowOptions withIdentityTranslation(IdentityTranslation identityTranslation) { + this.identityTranslation = identityTranslation; + return this; + } + + /** + * Get the senderClientId property: Sender's app user assigned Manage Identity client ID. + * + * @return the senderClientId value. + */ + public String senderClientId() { + return this.senderClientId; + } + + /** + * Set the senderClientId property: Sender's app user assigned Manage Identity client ID. + * + * @param senderClientId the senderClientId value to set. + * @return the ApiFlowOptions object itself. + */ + public ApiFlowOptions withSenderClientId(String senderClientId) { + this.senderClientId = senderClientId; + return this; + } + + /** + * Get the remoteCallingModeClientId property: Remote stub app registration Client ID. + * + * @return the remoteCallingModeClientId value. + */ + public String remoteCallingModeClientId() { + return this.remoteCallingModeClientId; + } + + /** + * Set the remoteCallingModeClientId property: Remote stub app registration Client ID. + * + * @param remoteCallingModeClientId the remoteCallingModeClientId value to set. + * @return the ApiFlowOptions object itself. + */ + public ApiFlowOptions withRemoteCallingModeClientId(String remoteCallingModeClientId) { + this.remoteCallingModeClientId = remoteCallingModeClientId; + return this; + } + + /** + * Get the audienceOverride property: Optional field to override the audience of the remote endpoint. + * + * @return the audienceOverride value. + */ + public String audienceOverride() { + return this.audienceOverride; + } + + /** + * Set the audienceOverride property: Optional field to override the audience of the remote endpoint. + * + * @param audienceOverride the audienceOverride value to set. + * @return the ApiFlowOptions object itself. + */ + public ApiFlowOptions withAudienceOverride(String audienceOverride) { + this.audienceOverride = audienceOverride; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("remoteEndpoint", this.remoteEndpoint); + jsonWriter.writeStringField("cname", this.cname); + jsonWriter.writeStringField("apiMode", this.apiMode == null ? null : this.apiMode.toString()); + jsonWriter.writeStringField("identityTranslation", + this.identityTranslation == null ? null : this.identityTranslation.toString()); + jsonWriter.writeStringField("senderClientId", this.senderClientId); + jsonWriter.writeStringField("remoteCallingModeClientId", this.remoteCallingModeClientId); + jsonWriter.writeStringField("audienceOverride", this.audienceOverride); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiFlowOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiFlowOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ApiFlowOptions. + */ + public static ApiFlowOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApiFlowOptions deserializedApiFlowOptions = new ApiFlowOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("remoteEndpoint".equals(fieldName)) { + deserializedApiFlowOptions.remoteEndpoint = reader.getString(); + } else if ("cname".equals(fieldName)) { + deserializedApiFlowOptions.cname = reader.getString(); + } else if ("apiMode".equals(fieldName)) { + deserializedApiFlowOptions.apiMode = ApiMode.fromString(reader.getString()); + } else if ("identityTranslation".equals(fieldName)) { + deserializedApiFlowOptions.identityTranslation = IdentityTranslation.fromString(reader.getString()); + } else if ("senderClientId".equals(fieldName)) { + deserializedApiFlowOptions.senderClientId = reader.getString(); + } else if ("remoteCallingModeClientId".equals(fieldName)) { + deserializedApiFlowOptions.remoteCallingModeClientId = reader.getString(); + } else if ("audienceOverride".equals(fieldName)) { + deserializedApiFlowOptions.audienceOverride = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApiFlowOptions; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ApiMode.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ApiMode.java new file mode 100644 index 000000000000..ea9ad877a543 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ApiMode.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Remote Calling Mode in the Azure Data Transfer API Flow, which describes how the API Flow will be invoked. + */ +public final class ApiMode extends ExpandableStringEnum { + /** + * Static value SDK for ApiMode. + */ + public static final ApiMode SDK = fromString("SDK"); + + /** + * Static value Endpoint for ApiMode. + */ + public static final ApiMode ENDPOINT = fromString("Endpoint"); + + /** + * Creates a new instance of ApiMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApiMode() { + } + + /** + * Creates or finds a ApiMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApiMode. + */ + public static ApiMode fromString(String name) { + return fromString(name, ApiMode.class); + } + + /** + * Gets known ApiMode values. + * + * @return known ApiMode values. + */ + public static Collection values() { + return values(ApiMode.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/AzureDataTransfers.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/AzureDataTransfers.java new file mode 100644 index 000000000000..645f1c3b559a --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/AzureDataTransfers.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.azuredatatransfer.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AzureDataTransfers. + */ +public interface AzureDataTransfers { + /** + * Lists approved schemas for Azure Data Transfer. + * + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result along with {@link Response}. + */ + Response listApprovedSchemasWithResponse(ListApprovedSchemasRequest body, Context context); + + /** + * Lists approved schemas for Azure Data Transfer. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result. + */ + SchemasListResult listApprovedSchemas(ListApprovedSchemasRequest body); + + /** + * Validates a schema for Azure Data Transfer. + * + * @param body The request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the schema validation along with {@link Response}. + */ + Response validateSchemaWithResponse(Schema body, Context context); + + /** + * Validates a schema for Azure Data Transfer. + * + * @param body The request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the schema validation. + */ + ValidateSchemaResult validateSchema(Schema body); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Connection.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Connection.java new file mode 100644 index 000000000000..830757f38222 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Connection.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ConnectionInner; +import java.util.Map; + +/** + * An immutable client-side representation of Connection. + */ +public interface Connection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: Properties of connection. + * + * @return the properties value. + */ + ConnectionProperties properties(); + + /** + * Gets the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.azuredatatransfer.fluent.models.ConnectionInner object. + * + * @return the inner object. + */ + ConnectionInner innerModel(); + + /** + * The entirety of the Connection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Connection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Connection definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Connection definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Connection 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 Connection definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithProperties, DefinitionStages.WithIdentity { + /** + * Executes the create request. + * + * @return the created resource. + */ + Connection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Connection create(Context context); + } + + /** + * The stage of the Connection definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Connection definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of connection. + * + * @param properties Properties of connection. + * @return the next definition stage. + */ + WithCreate withProperties(ConnectionProperties properties); + } + + /** + * The stage of the Connection definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + } + + /** + * Begins update for the Connection resource. + * + * @return the stage of resource update. + */ + Connection.Update update(); + + /** + * The template for Connection update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Connection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Connection apply(Context context); + } + + /** + * The Connection update stages. + */ + interface UpdateStages { + /** + * The stage of the Connection update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the Connection update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Connection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Connection refresh(Context context); + + /** + * Links the connection to its pending connection. + * + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + Connection link(ResourceBody body); + + /** + * Links the connection to its pending connection. + * + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + Connection link(ResourceBody body, Context context); + + /** + * Lists all pending connections for a connection. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingConnection list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all pending connections for a connection. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingConnection list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists all pending flows for a connection. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingFlow list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listPendingFlowsList(); + + /** + * Lists all pending flows for a connection. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingFlow list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listPendingFlowsList(Context context); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionIdList.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionIdList.java new file mode 100644 index 000000000000..777aa8ded4ab --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionIdList.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * An array of connection id resources. + */ +@Fluent +public final class ConnectionIdList implements JsonSerializable { + /* + * Connection ID to target + */ + private List value; + + /** + * Creates an instance of ConnectionIdList class. + */ + public ConnectionIdList() { + } + + /** + * Get the value property: Connection ID to target. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Connection ID to target. + * + * @param value the value value to set. + * @return the ConnectionIdList object itself. + */ + public ConnectionIdList withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionIdList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionIdList if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionIdList. + */ + public static ConnectionIdList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionIdList deserializedConnectionIdList = new ConnectionIdList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectionIdList.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionIdList; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionListResult.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionListResult.java new file mode 100644 index 000000000000..01b96d916b97 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionListResult.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.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Connection list operation. + */ +@Fluent +public final class ConnectionListResult implements JsonSerializable { + /* + * The Connection items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ConnectionListResult class. + */ + public ConnectionListResult() { + } + + /** + * Get the value property: The Connection items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Connection items on this page. + * + * @param value the value value to set. + * @return the ConnectionListResult object itself. + */ + public ConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ConnectionListResult object itself. + */ + public ConnectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ConnectionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectionListResult. + */ + public static ConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionListResult deserializedConnectionListResult = new ConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ConnectionInner.fromJson(reader1)); + deserializedConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionListResult; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionProperties.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionProperties.java new file mode 100644 index 000000000000..4616a8fa15b4 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionProperties.java @@ -0,0 +1,554 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Properties of connection. + */ +@Fluent +public final class ConnectionProperties implements JsonSerializable { + /* + * Pipeline to use to transfer data + */ + private String pipeline; + + /* + * Direction of data movement + */ + private Direction direction; + + /* + * Justification for the connection request + */ + private String justification; + + /* + * Status of the connection + */ + private ConnectionStatus status; + + /* + * Force disablement status of the current connection + */ + private List forceDisabledStatus; + + /* + * Reason for status + */ + private String statusReason; + + /* + * Link status of the current connection + */ + private LinkStatus linkStatus; + + /* + * Resource ID of the linked connection + */ + private String linkedConnectionId; + + /* + * The flow types being requested for this connection + */ + private List flowTypes; + + /* + * Requirement ID of the connection + */ + private String requirementId; + + /* + * Subscription ID to link cloud subscriptions together + */ + private String remoteSubscriptionId; + + /* + * Approver of this connection request + */ + private String approver; + + /* + * PIN to link requests together + */ + private String pin; + + /* + * The timestamp that this connection request was submitted at + */ + private OffsetDateTime dateSubmitted; + + /* + * The primary contact for this connection request + */ + private String primaryContact; + + /* + * The secondary contacts for this connection request + */ + private List secondaryContacts; + + /* + * Provisioning state of the connection + */ + private ProvisioningState provisioningState; + + /* + * The policies for this connection + */ + private List policies; + + /* + * The schemas for this connection + */ + private List schemas; + + /* + * The schema URIs for this connection + */ + private List schemaUris; + + /** + * Creates an instance of ConnectionProperties class. + */ + public ConnectionProperties() { + } + + /** + * Get the pipeline property: Pipeline to use to transfer data. + * + * @return the pipeline value. + */ + public String pipeline() { + return this.pipeline; + } + + /** + * Set the pipeline property: Pipeline to use to transfer data. + * + * @param pipeline the pipeline value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withPipeline(String pipeline) { + this.pipeline = pipeline; + return this; + } + + /** + * Get the direction property: Direction of data movement. + * + * @return the direction value. + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction property: Direction of data movement. + * + * @param direction the direction value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get the justification property: Justification for the connection request. + * + * @return the justification value. + */ + public String justification() { + return this.justification; + } + + /** + * Set the justification property: Justification for the connection request. + * + * @param justification the justification value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withJustification(String justification) { + this.justification = justification; + return this; + } + + /** + * Get the status property: Status of the connection. + * + * @return the status value. + */ + public ConnectionStatus status() { + return this.status; + } + + /** + * Get the forceDisabledStatus property: Force disablement status of the current connection. + * + * @return the forceDisabledStatus value. + */ + public List forceDisabledStatus() { + return this.forceDisabledStatus; + } + + /** + * Get the statusReason property: Reason for status. + * + * @return the statusReason value. + */ + public String statusReason() { + return this.statusReason; + } + + /** + * Get the linkStatus property: Link status of the current connection. + * + * @return the linkStatus value. + */ + public LinkStatus linkStatus() { + return this.linkStatus; + } + + /** + * Get the linkedConnectionId property: Resource ID of the linked connection. + * + * @return the linkedConnectionId value. + */ + public String linkedConnectionId() { + return this.linkedConnectionId; + } + + /** + * Get the flowTypes property: The flow types being requested for this connection. + * + * @return the flowTypes value. + */ + public List flowTypes() { + return this.flowTypes; + } + + /** + * Set the flowTypes property: The flow types being requested for this connection. + * + * @param flowTypes the flowTypes value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withFlowTypes(List flowTypes) { + this.flowTypes = flowTypes; + return this; + } + + /** + * Get the requirementId property: Requirement ID of the connection. + * + * @return the requirementId value. + */ + public String requirementId() { + return this.requirementId; + } + + /** + * Set the requirementId property: Requirement ID of the connection. + * + * @param requirementId the requirementId value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withRequirementId(String requirementId) { + this.requirementId = requirementId; + return this; + } + + /** + * Get the remoteSubscriptionId property: Subscription ID to link cloud subscriptions together. + * + * @return the remoteSubscriptionId value. + */ + public String remoteSubscriptionId() { + return this.remoteSubscriptionId; + } + + /** + * Set the remoteSubscriptionId property: Subscription ID to link cloud subscriptions together. + * + * @param remoteSubscriptionId the remoteSubscriptionId value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withRemoteSubscriptionId(String remoteSubscriptionId) { + this.remoteSubscriptionId = remoteSubscriptionId; + return this; + } + + /** + * Get the approver property: Approver of this connection request. + * + * @return the approver value. + */ + public String approver() { + return this.approver; + } + + /** + * Get the pin property: PIN to link requests together. + * + * @return the pin value. + */ + public String pin() { + return this.pin; + } + + /** + * Set the pin property: PIN to link requests together. + * + * @param pin the pin value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withPin(String pin) { + this.pin = pin; + return this; + } + + /** + * Get the dateSubmitted property: The timestamp that this connection request was submitted at. + * + * @return the dateSubmitted value. + */ + public OffsetDateTime dateSubmitted() { + return this.dateSubmitted; + } + + /** + * Get the primaryContact property: The primary contact for this connection request. + * + * @return the primaryContact value. + */ + public String primaryContact() { + return this.primaryContact; + } + + /** + * Set the primaryContact property: The primary contact for this connection request. + * + * @param primaryContact the primaryContact value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withPrimaryContact(String primaryContact) { + this.primaryContact = primaryContact; + return this; + } + + /** + * Get the secondaryContacts property: The secondary contacts for this connection request. + * + * @return the secondaryContacts value. + */ + public List secondaryContacts() { + return this.secondaryContacts; + } + + /** + * Set the secondaryContacts property: The secondary contacts for this connection request. + * + * @param secondaryContacts the secondaryContacts value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withSecondaryContacts(List secondaryContacts) { + this.secondaryContacts = secondaryContacts; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the connection. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the policies property: The policies for this connection. + * + * @return the policies value. + */ + public List policies() { + return this.policies; + } + + /** + * Set the policies property: The policies for this connection. + * + * @param policies the policies value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withPolicies(List policies) { + this.policies = policies; + return this; + } + + /** + * Get the schemas property: The schemas for this connection. + * + * @return the schemas value. + */ + public List schemas() { + return this.schemas; + } + + /** + * Set the schemas property: The schemas for this connection. + * + * @param schemas the schemas value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withSchemas(List schemas) { + this.schemas = schemas; + return this; + } + + /** + * Get the schemaUris property: The schema URIs for this connection. + * + * @return the schemaUris value. + */ + public List schemaUris() { + return this.schemaUris; + } + + /** + * Set the schemaUris property: The schema URIs for this connection. + * + * @param schemaUris the schemaUris value to set. + * @return the ConnectionProperties object itself. + */ + public ConnectionProperties withSchemaUris(List schemaUris) { + this.schemaUris = schemaUris; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (pipeline() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property pipeline in model ConnectionProperties")); + } + if (schemas() != null) { + schemas().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pipeline", this.pipeline); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + jsonWriter.writeStringField("justification", this.justification); + jsonWriter.writeArrayField("flowTypes", this.flowTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("requirementId", this.requirementId); + jsonWriter.writeStringField("remoteSubscriptionId", this.remoteSubscriptionId); + jsonWriter.writeStringField("pin", this.pin); + jsonWriter.writeStringField("primaryContact", this.primaryContact); + jsonWriter.writeArrayField("secondaryContacts", this.secondaryContacts, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("policies", this.policies, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("schemas", this.schemas, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("schemaUris", this.schemaUris, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ConnectionProperties. + */ + public static ConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionProperties deserializedConnectionProperties = new ConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pipeline".equals(fieldName)) { + deserializedConnectionProperties.pipeline = reader.getString(); + } else if ("direction".equals(fieldName)) { + deserializedConnectionProperties.direction = Direction.fromString(reader.getString()); + } else if ("justification".equals(fieldName)) { + deserializedConnectionProperties.justification = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedConnectionProperties.status = ConnectionStatus.fromString(reader.getString()); + } else if ("forceDisabledStatus".equals(fieldName)) { + List forceDisabledStatus + = reader.readArray(reader1 -> ForceDisabledStatus.fromString(reader1.getString())); + deserializedConnectionProperties.forceDisabledStatus = forceDisabledStatus; + } else if ("statusReason".equals(fieldName)) { + deserializedConnectionProperties.statusReason = reader.getString(); + } else if ("linkStatus".equals(fieldName)) { + deserializedConnectionProperties.linkStatus = LinkStatus.fromString(reader.getString()); + } else if ("linkedConnectionId".equals(fieldName)) { + deserializedConnectionProperties.linkedConnectionId = reader.getString(); + } else if ("flowTypes".equals(fieldName)) { + List flowTypes = reader.readArray(reader1 -> FlowType.fromString(reader1.getString())); + deserializedConnectionProperties.flowTypes = flowTypes; + } else if ("requirementId".equals(fieldName)) { + deserializedConnectionProperties.requirementId = reader.getString(); + } else if ("remoteSubscriptionId".equals(fieldName)) { + deserializedConnectionProperties.remoteSubscriptionId = reader.getString(); + } else if ("approver".equals(fieldName)) { + deserializedConnectionProperties.approver = reader.getString(); + } else if ("pin".equals(fieldName)) { + deserializedConnectionProperties.pin = reader.getString(); + } else if ("dateSubmitted".equals(fieldName)) { + deserializedConnectionProperties.dateSubmitted = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("primaryContact".equals(fieldName)) { + deserializedConnectionProperties.primaryContact = reader.getString(); + } else if ("secondaryContacts".equals(fieldName)) { + List secondaryContacts = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectionProperties.secondaryContacts = secondaryContacts; + } else if ("provisioningState".equals(fieldName)) { + deserializedConnectionProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("policies".equals(fieldName)) { + List policies = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectionProperties.policies = policies; + } else if ("schemas".equals(fieldName)) { + List schemas = reader.readArray(reader1 -> Schema.fromJson(reader1)); + deserializedConnectionProperties.schemas = schemas; + } else if ("schemaUris".equals(fieldName)) { + List schemaUris = reader.readArray(reader1 -> reader1.getString()); + deserializedConnectionProperties.schemaUris = schemaUris; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionProperties; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionStatus.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionStatus.java new file mode 100644 index 000000000000..4f842725aeeb --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionStatus.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the connection. + */ +public final class ConnectionStatus extends ExpandableStringEnum { + /** + * Static value InReview for ConnectionStatus. + */ + public static final ConnectionStatus IN_REVIEW = fromString("InReview"); + + /** + * Static value Approved for ConnectionStatus. + */ + public static final ConnectionStatus APPROVED = fromString("Approved"); + + /** + * Static value Rejected for ConnectionStatus. + */ + public static final ConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Static value Accepted for ConnectionStatus. + */ + public static final ConnectionStatus ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of ConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectionStatus() { + } + + /** + * Creates or finds a ConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionStatus. + */ + public static ConnectionStatus fromString(String name) { + return fromString(name, ConnectionStatus.class); + } + + /** + * Gets known ConnectionStatus values. + * + * @return known ConnectionStatus values. + */ + public static Collection values() { + return values(ConnectionStatus.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Connections.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Connections.java new file mode 100644 index 000000000000..a4c8af1096af --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Connections.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.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 Connections. + */ +public interface Connections { + /** + * Gets connections in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscription(); + + /** + * Gets connections in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscription(Context context); + + /** + * Gets connections in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets connections in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connections in a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection resource along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String connectionName, + Context context); + + /** + * Gets connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection resource. + */ + Connection getByResourceGroup(String resourceGroupName, String connectionName); + + /** + * Deletes the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String connectionName); + + /** + * Deletes the connection resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String connectionName, Context context); + + /** + * Links the connection to its pending connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + Connection link(String resourceGroupName, String connectionName, ResourceBody body); + + /** + * Links the connection to its pending connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + Connection link(String resourceGroupName, String connectionName, ResourceBody body, Context context); + + /** + * Lists all pending connections for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingConnection list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String connectionName); + + /** + * Lists all pending connections for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingConnection list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String connectionName, Context context); + + /** + * Lists all pending flows for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingFlow list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listPendingFlowsList(String resourceGroupName, String connectionName); + + /** + * Lists all pending flows for a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PendingFlow list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listPendingFlowsList(String resourceGroupName, String connectionName, Context context); + + /** + * Gets connection resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection resource along with {@link Response}. + */ + Connection getById(String id); + + /** + * Gets connection resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the connection resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the connection resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Connection resource. + * + * @param name resource name. + * @return the first stage of the new Connection definition. + */ + Connection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionsPatch.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionsPatch.java new file mode 100644 index 000000000000..3350b46c0c06 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ConnectionsPatch.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The connections resource patch definition. + */ +@Fluent +public final class ConnectionsPatch implements JsonSerializable { + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of ConnectionsPatch class. + */ + public ConnectionsPatch() { + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the ConnectionsPatch object itself. + */ + public ConnectionsPatch withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ConnectionsPatch object itself. + */ + public ConnectionsPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ConnectionsPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ConnectionsPatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ConnectionsPatch. + */ + public static ConnectionsPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ConnectionsPatch deserializedConnectionsPatch = new ConnectionsPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedConnectionsPatch.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedConnectionsPatch.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedConnectionsPatch; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/DataType.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/DataType.java new file mode 100644 index 000000000000..17f6779005dd --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/DataType.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Transfer Storage Blobs or Tables. + */ +public final class DataType extends ExpandableStringEnum { + /** + * Static value Blob for DataType. + */ + public static final DataType BLOB = fromString("Blob"); + + /** + * Static value Table for DataType. + */ + public static final DataType TABLE = fromString("Table"); + + /** + * Creates a new instance of DataType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataType() { + } + + /** + * Creates or finds a DataType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataType. + */ + public static DataType fromString(String name) { + return fromString(name, DataType.class); + } + + /** + * Gets known DataType values. + * + * @return known DataType values. + */ + public static Collection values() { + return values(DataType.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Direction.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Direction.java new file mode 100644 index 000000000000..170564e0b69c --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Direction.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Direction of data movement. + */ +public final class Direction extends ExpandableStringEnum { + /** + * Static value Send for Direction. + */ + public static final Direction SEND = fromString("Send"); + + /** + * Static value Receive for Direction. + */ + public static final Direction RECEIVE = fromString("Receive"); + + /** + * Creates a new instance of Direction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Direction() { + } + + /** + * Creates or finds a Direction from its string representation. + * + * @param name a name to look for. + * @return the corresponding Direction. + */ + public static Direction fromString(String name) { + return fromString(name, Direction.class); + } + + /** + * Gets known Direction values. + * + * @return known Direction values. + */ + public static Collection values() { + return values(Direction.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Flow.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Flow.java new file mode 100644 index 000000000000..12efff38c9d5 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Flow.java @@ -0,0 +1,564 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.FlowInner; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.FlowPropertiesInner; +import java.util.Map; + +/** + * An immutable client-side representation of Flow. + */ +public interface Flow { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: Properties of flow. + * + * @return the properties value. + */ + FlowProperties properties(); + + /** + * Gets the plan property: Details of the resource plan. + * + * @return the plan value. + */ + Plan plan(); + + /** + * Gets the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.azuredatatransfer.fluent.models.FlowInner object. + * + * @return the inner object. + */ + FlowInner innerModel(); + + /** + * The entirety of the Flow definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The Flow definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Flow definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Flow definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** + * The stage of the Flow definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, connectionName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @return the next definition stage. + */ + WithCreate withExistingConnection(String resourceGroupName, String connectionName); + } + + /** + * The stage of the Flow definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties, + DefinitionStages.WithPlan, DefinitionStages.WithIdentity { + /** + * Executes the create request. + * + * @return the created resource. + */ + Flow create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Flow create(Context context); + } + + /** + * The stage of the Flow definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Flow definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of flow. + * + * @param properties Properties of flow. + * @return the next definition stage. + */ + WithCreate withProperties(FlowPropertiesInner properties); + } + + /** + * The stage of the Flow definition allowing to specify plan. + */ + interface WithPlan { + /** + * Specifies the plan property: Details of the resource plan.. + * + * @param plan Details of the resource plan. + * @return the next definition stage. + */ + WithCreate withPlan(Plan plan); + } + + /** + * The stage of the Flow definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + } + + /** + * Begins update for the Flow resource. + * + * @return the stage of resource update. + */ + Flow.Update update(); + + /** + * The template for Flow update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Flow apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Flow apply(Context context); + } + + /** + * The Flow update stages. + */ + interface UpdateStages { + /** + * The stage of the Flow update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the Flow update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Flow refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Flow refresh(Context context); + + /** + * Disables the specified flow. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow disable(); + + /** + * Disables the specified flow. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow disable(Context context); + + /** + * Enables the specified flow. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow enable(); + + /** + * Enables the specified flow. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow enable(Context context); + + /** + * Generate a compliant passphrase for the specified flow. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow generatePassphrase(); + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow generatePassphrase(Context context); + + /** + * Get the destination endpoint ports for the specified flow and stream ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoint ports for the specified flow and stream ID along with {@link Response}. + */ + Response getDestinationEndpointPortsWithResponse(Context context); + + /** + * Get the destination endpoint ports for the specified flow and stream ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoint ports for the specified flow and stream ID. + */ + GetDestinationEndpointPortsResult getDestinationEndpointPorts(); + + /** + * Get the destination endpoints for the specified flow and stream ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoints for the specified flow and stream ID along with {@link Response}. + */ + Response getDestinationEndpointsWithResponse(Context context); + + /** + * Get the destination endpoints for the specified flow and stream ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoints for the specified flow and stream ID. + */ + GetDestinationEndpointsResult getDestinationEndpoints(); + + /** + * Get the source addresses for the specified flow. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source addresses for the specified flow along with {@link Response}. + */ + Response getSourceAddressesWithResponse(Context context); + + /** + * Get the source addresses for the specified flow. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source addresses for the specified flow. + */ + StreamSourceAddresses getSourceAddresses(); + + /** + * Get the connection string for the specified flow. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection string for the specified flow along with {@link Response}. + */ + Response getStreamConnectionStringWithResponse(Context context); + + /** + * Get the connection string for the specified flow. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection string for the specified flow. + */ + GetStreamConnectionStringResult getStreamConnectionString(); + + /** + * Links the specified flow. + * + * @param body Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow link(ResourceBody body); + + /** + * Links the specified flow. + * + * @param body Flow body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow link(ResourceBody body, Context context); + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param body Stream ID destination endpoint ports wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setDestinationEndpointPorts(SetDestinationEndpointPorts body); + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param body Stream ID destination endpoint ports wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setDestinationEndpointPorts(SetDestinationEndpointPorts body, Context context); + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param body Stream ID destination endpoints wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setDestinationEndpoints(SetDestinationEndpoints body); + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param body Stream ID destination endpoints wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setDestinationEndpoints(SetDestinationEndpoints body, Context context); + + /** + * Sets the passphrase of the specified flow. + * + * @param body Passphrase to set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setPassphrase(SetStreamPassphrase body); + + /** + * Sets the passphrase of the specified flow. + * + * @param body Passphrase to set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setPassphrase(SetStreamPassphrase body, Context context); + + /** + * Set the source addresses for the specified flow. + * + * @param body Source addresses wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setSourceAddresses(SetSourceAddresses body); + + /** + * Set the source addresses for the specified flow. + * + * @param body Source addresses wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setSourceAddresses(SetSourceAddresses body, Context context); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowBillingTier.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowBillingTier.java new file mode 100644 index 000000000000..555ce1648a5c --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowBillingTier.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Billing tier for this messaging flow. + */ +public final class FlowBillingTier extends ExpandableStringEnum { + /** + * Static value BlobTransport for FlowBillingTier. + */ + public static final FlowBillingTier BLOB_TRANSPORT = fromString("BlobTransport"); + + /** + * Static value Standard for FlowBillingTier. + */ + public static final FlowBillingTier STANDARD = fromString("Standard"); + + /** + * Static value Premium for FlowBillingTier. + */ + public static final FlowBillingTier PREMIUM = fromString("Premium"); + + /** + * Creates a new instance of FlowBillingTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FlowBillingTier() { + } + + /** + * Creates or finds a FlowBillingTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding FlowBillingTier. + */ + public static FlowBillingTier fromString(String name) { + return fromString(name, FlowBillingTier.class); + } + + /** + * Gets known FlowBillingTier values. + * + * @return known FlowBillingTier values. + */ + public static Collection values() { + return values(FlowBillingTier.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowListResult.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowListResult.java new file mode 100644 index 000000000000..3fa0bbd089b1 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowListResult.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.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.FlowInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Flow list operation. + */ +@Fluent +public final class FlowListResult implements JsonSerializable { + /* + * The Flow items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of FlowListResult class. + */ + public FlowListResult() { + } + + /** + * Get the value property: The Flow items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Flow items on this page. + * + * @param value the value value to set. + * @return the FlowListResult object itself. + */ + public FlowListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the FlowListResult object itself. + */ + public FlowListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model FlowListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FlowListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FlowListResult. + */ + public static FlowListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowListResult deserializedFlowListResult = new FlowListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> FlowInner.fromJson(reader1)); + deserializedFlowListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFlowListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFlowListResult; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowProperties.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowProperties.java new file mode 100644 index 000000000000..0463e9a01397 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowProperties.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.azuredatatransfer.models; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.FlowPropertiesInner; +import java.util.List; + +/** + * An immutable client-side representation of FlowProperties. + */ +public interface FlowProperties { + /** + * Gets the connection property: The connection associated with this flow. + * + * @return the connection value. + */ + SelectedResource connection(); + + /** + * Gets the flowId property: Dataflow GUID associated with this flow. + * + * @return the flowId value. + */ + String flowId(); + + /** + * Gets the keyVaultUri property: AME, PME, or TORUS only! AKV Chain Containing SAS Token. + * + * @return the keyVaultUri value. + */ + String keyVaultUri(); + + /** + * Gets the linkStatus property: Link status of the current flow. + * + * @return the linkStatus value. + */ + LinkStatus linkStatus(); + + /** + * Gets the linkedFlowId property: Resource ID of the linked flow. + * + * @return the linkedFlowId value. + */ + String linkedFlowId(); + + /** + * Gets the status property: Status of the current flow. + * + * @return the status value. + */ + FlowStatus status(); + + /** + * Gets the forceDisabledStatus property: Force disablement status of the current flow. + * + * @return the forceDisabledStatus value. + */ + List forceDisabledStatus(); + + /** + * Gets the storageAccountName property: Storage Account. + * + * @return the storageAccountName value. + */ + String storageAccountName(); + + /** + * Gets the storageAccountId property: Storage Account ID. + * + * @return the storageAccountId value. + */ + String storageAccountId(); + + /** + * Gets the storageContainerName property: Storage Container Name. + * + * @return the storageContainerName value. + */ + String storageContainerName(); + + /** + * Gets the storageTableName property: Storage Table Name. + * + * @return the storageTableName value. + */ + String storageTableName(); + + /** + * Gets the serviceBusQueueId property: Service Bus Queue ID. + * + * @return the serviceBusQueueId value. + */ + String serviceBusQueueId(); + + /** + * Gets the flowType property: The flow type for this flow. + * + * @return the flowType value. + */ + FlowType flowType(); + + /** + * Gets the dataType property: Transfer Storage Blobs or Tables. + * + * @return the dataType value. + */ + DataType dataType(); + + /** + * Gets the provisioningState property: Provisioning state of the flow. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the policies property: The policies for this flow. + * + * @return the policies value. + */ + List policies(); + + /** + * Gets the schema property: The selected schema for this flow. + * + * @return the schema value. + */ + Schema schema(); + + /** + * Gets the messagingOptions property: The messaging options for this flow. + * + * @return the messagingOptions value. + */ + MessagingOptions messagingOptions(); + + /** + * Gets the apiFlowOptions property: The API Flow configuration options for Azure Data Transfer API Flow type. + * + * @return the apiFlowOptions value. + */ + ApiFlowOptions apiFlowOptions(); + + /** + * Gets the customerManagedKeyVaultUri property: The URI to the customer managed key for this flow. + * + * @return the customerManagedKeyVaultUri value. + */ + String customerManagedKeyVaultUri(); + + /** + * Gets the streamId property: The flow stream identifier. + * + * @return the streamId value. + */ + String streamId(); + + /** + * Gets the streamProtocol property: The protocol of the stream. + * + * @return the streamProtocol value. + */ + StreamProtocol streamProtocol(); + + /** + * Gets the streamLatency property: The latency of the stream in milliseconds. + * + * @return the streamLatency value. + */ + Long streamLatency(); + + /** + * Gets the passphrase property: The passphrase used for SRT streams. + * + * @return the passphrase value. + */ + String passphrase(); + + /** + * Gets the sourceAddresses property: The source IP address and CIDR ranges of the stream. + * + * @return the sourceAddresses value. + */ + StreamSourceAddresses sourceAddresses(); + + /** + * Gets the destinationEndpoints property: The destination endpoints of the stream. + * + * @return the destinationEndpoints value. + */ + List destinationEndpoints(); + + /** + * Gets the destinationEndpointPorts property: The destination endpoint ports of the stream. + * + * @return the destinationEndpointPorts value. + */ + List destinationEndpointPorts(); + + /** + * Gets the eventHubId property: Event Hub ID. + * + * @return the eventHubId value. + */ + String eventHubId(); + + /** + * Gets the consumerGroup property: Event Hub Consumer Group. + * + * @return the consumerGroup value. + */ + String consumerGroup(); + + /** + * Gets the inner com.azure.resourcemanager.azuredatatransfer.fluent.models.FlowPropertiesInner object. + * + * @return the inner object. + */ + FlowPropertiesInner innerModel(); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowStatus.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowStatus.java new file mode 100644 index 000000000000..fa75092b7fb1 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowStatus.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the current flow. + */ +public final class FlowStatus extends ExpandableStringEnum { + /** + * Static value Enabled for FlowStatus. + */ + public static final FlowStatus ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for FlowStatus. + */ + public static final FlowStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of FlowStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FlowStatus() { + } + + /** + * Creates or finds a FlowStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding FlowStatus. + */ + public static FlowStatus fromString(String name) { + return fromString(name, FlowStatus.class); + } + + /** + * Gets known FlowStatus values. + * + * @return known FlowStatus values. + */ + public static Collection values() { + return values(FlowStatus.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowType.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowType.java new file mode 100644 index 000000000000..10673da602d4 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowType.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Flow type for the specified resource. + */ +public final class FlowType extends ExpandableStringEnum { + /** + * Static value Unknown for FlowType. + */ + public static final FlowType UNKNOWN = fromString("Unknown"); + + /** + * Static value Complex for FlowType. + */ + public static final FlowType COMPLEX = fromString("Complex"); + + /** + * Static value DevSecOps for FlowType. + */ + public static final FlowType DEV_SEC_OPS = fromString("DevSecOps"); + + /** + * Static value Messaging for FlowType. + */ + public static final FlowType MESSAGING = fromString("Messaging"); + + /** + * Static value Mission for FlowType. + */ + public static final FlowType MISSION = fromString("Mission"); + + /** + * Static value MicrosoftInternal for FlowType. + */ + public static final FlowType MICROSOFT_INTERNAL = fromString("MicrosoftInternal"); + + /** + * Static value BasicFiles for FlowType. + */ + public static final FlowType BASIC_FILES = fromString("BasicFiles"); + + /** + * Static value Data for FlowType. + */ + public static final FlowType DATA = fromString("Data"); + + /** + * Static value Standard for FlowType. + */ + public static final FlowType STANDARD = fromString("Standard"); + + /** + * Static value StreamingVideo for FlowType. + */ + public static final FlowType STREAMING_VIDEO = fromString("StreamingVideo"); + + /** + * Static value Opaque for FlowType. + */ + public static final FlowType OPAQUE = fromString("Opaque"); + + /** + * Static value MissionOpaqueXML for FlowType. + */ + public static final FlowType MISSION_OPAQUE_XML = fromString("MissionOpaqueXML"); + + /** + * Static value DiskImages for FlowType. + */ + public static final FlowType DISK_IMAGES = fromString("DiskImages"); + + /** + * Static value API for FlowType. + */ + public static final FlowType API = fromString("API"); + + /** + * Creates a new instance of FlowType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FlowType() { + } + + /** + * Creates or finds a FlowType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FlowType. + */ + public static FlowType fromString(String name) { + return fromString(name, FlowType.class); + } + + /** + * Gets known FlowType values. + * + * @return known FlowType values. + */ + public static Collection values() { + return values(FlowType.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Flows.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Flows.java new file mode 100644 index 000000000000..f66697cbce4a --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Flows.java @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.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 Flows. + */ +public interface Flows { + /** + * Gets flows in a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flows in a connection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByConnection(String resourceGroupName, String connectionName); + + /** + * Gets flows in a connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flows in a connection as paginated response with {@link PagedIterable}. + */ + PagedIterable listByConnection(String resourceGroupName, String connectionName, Context context); + + /** + * Gets flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flow resource along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String connectionName, String flowName, Context context); + + /** + * Gets flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flow resource. + */ + Flow get(String resourceGroupName, String connectionName, String flowName); + + /** + * Deletes the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String connectionName, String flowName); + + /** + * Deletes the flow resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String connectionName, String flowName, Context context); + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow disable(String resourceGroupName, String connectionName, String flowName); + + /** + * Disables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow disable(String resourceGroupName, String connectionName, String flowName, Context context); + + /** + * Enables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow enable(String resourceGroupName, String connectionName, String flowName); + + /** + * Enables the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow enable(String resourceGroupName, String connectionName, String flowName, Context context); + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow generatePassphrase(String resourceGroupName, String connectionName, String flowName); + + /** + * Generate a compliant passphrase for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow generatePassphrase(String resourceGroupName, String connectionName, String flowName, Context context); + + /** + * Get the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoint ports for the specified flow and stream ID along with {@link Response}. + */ + Response getDestinationEndpointPortsWithResponse(String resourceGroupName, + String connectionName, String flowName, Context context); + + /** + * Get the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoint ports for the specified flow and stream ID. + */ + GetDestinationEndpointPortsResult getDestinationEndpointPorts(String resourceGroupName, String connectionName, + String flowName); + + /** + * Get the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoints for the specified flow and stream ID along with {@link Response}. + */ + Response getDestinationEndpointsWithResponse(String resourceGroupName, + String connectionName, String flowName, Context context); + + /** + * Get the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the destination endpoints for the specified flow and stream ID. + */ + GetDestinationEndpointsResult getDestinationEndpoints(String resourceGroupName, String connectionName, + String flowName); + + /** + * Get the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source addresses for the specified flow along with {@link Response}. + */ + Response getSourceAddressesWithResponse(String resourceGroupName, String connectionName, + String flowName, Context context); + + /** + * Get the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the source addresses for the specified flow. + */ + StreamSourceAddresses getSourceAddresses(String resourceGroupName, String connectionName, String flowName); + + /** + * Get the connection string for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection string for the specified flow along with {@link Response}. + */ + Response getStreamConnectionStringWithResponse(String resourceGroupName, + String connectionName, String flowName, Context context); + + /** + * Get the connection string for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection string for the specified flow. + */ + GetStreamConnectionStringResult getStreamConnectionString(String resourceGroupName, String connectionName, + String flowName); + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Flow body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow link(String resourceGroupName, String connectionName, String flowName, ResourceBody body); + + /** + * Links the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Flow body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow link(String resourceGroupName, String connectionName, String flowName, ResourceBody body, Context context); + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoint ports wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setDestinationEndpointPorts(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpointPorts body); + + /** + * Set the destination endpoint ports for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoint ports wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setDestinationEndpointPorts(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpointPorts body, Context context); + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoints wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setDestinationEndpoints(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpoints body); + + /** + * Set the destination endpoints for the specified flow and stream ID. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Stream ID destination endpoints wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setDestinationEndpoints(String resourceGroupName, String connectionName, String flowName, + SetDestinationEndpoints body, Context context); + + /** + * Sets the passphrase of the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Passphrase to set. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setPassphrase(String resourceGroupName, String connectionName, String flowName, SetStreamPassphrase body); + + /** + * Sets the passphrase of the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Passphrase to set. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setPassphrase(String resourceGroupName, String connectionName, String flowName, SetStreamPassphrase body, + Context context); + + /** + * Set the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Source addresses wanted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setSourceAddresses(String resourceGroupName, String connectionName, String flowName, SetSourceAddresses body); + + /** + * Set the source addresses for the specified flow. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param connectionName The name for the connection that is to be requested. + * @param flowName The name for the flow that is to be onboarded. + * @param body Source addresses wanted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the flow resource definition. + */ + Flow setSourceAddresses(String resourceGroupName, String connectionName, String flowName, SetSourceAddresses body, + Context context); + + /** + * Gets flow resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flow resource along with {@link Response}. + */ + Flow getById(String id); + + /** + * Gets flow resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return flow resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the flow resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the flow resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Flow resource. + * + * @param name resource name. + * @return the first stage of the new Flow definition. + */ + Flow.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowsPatch.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowsPatch.java new file mode 100644 index 000000000000..6022019c5ff2 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/FlowsPatch.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The flows resource patch definition. + */ +@Fluent +public final class FlowsPatch implements JsonSerializable { + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Resource tags. + */ + private Map tags; + + /** + * Creates an instance of FlowsPatch class. + */ + public FlowsPatch() { + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the FlowsPatch object itself. + */ + public FlowsPatch withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the FlowsPatch object itself. + */ + public FlowsPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FlowsPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FlowsPatch if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the FlowsPatch. + */ + public static FlowsPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FlowsPatch deserializedFlowsPatch = new FlowsPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedFlowsPatch.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedFlowsPatch.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedFlowsPatch; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ForceDisabledStatus.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ForceDisabledStatus.java new file mode 100644 index 000000000000..e71fc2a01db1 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ForceDisabledStatus.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of force disablement. + */ +public final class ForceDisabledStatus extends ExpandableStringEnum { + /** + * Static value ConnectionForceDisabled for ForceDisabledStatus. + */ + public static final ForceDisabledStatus CONNECTION_FORCE_DISABLED = fromString("ConnectionForceDisabled"); + + /** + * Static value FlowTypeForceDisabled for ForceDisabledStatus. + */ + public static final ForceDisabledStatus FLOW_TYPE_FORCE_DISABLED = fromString("FlowTypeForceDisabled"); + + /** + * Creates a new instance of ForceDisabledStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ForceDisabledStatus() { + } + + /** + * Creates or finds a ForceDisabledStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ForceDisabledStatus. + */ + public static ForceDisabledStatus fromString(String name) { + return fromString(name, ForceDisabledStatus.class); + } + + /** + * Gets known ForceDisabledStatus values. + * + * @return known ForceDisabledStatus values. + */ + public static Collection values() { + return values(ForceDisabledStatus.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/GetDestinationEndpointPortsResult.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/GetDestinationEndpointPortsResult.java new file mode 100644 index 000000000000..0b07ed790a1f --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/GetDestinationEndpointPortsResult.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.azuredatatransfer.models; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.GetDestinationEndpointPortsResultInner; +import java.util.List; + +/** + * An immutable client-side representation of GetDestinationEndpointPortsResult. + */ +public interface GetDestinationEndpointPortsResult { + /** + * Gets the ports property: The destination endpoint port for the flow stream. + * + * @return the ports value. + */ + List ports(); + + /** + * Gets the inner com.azure.resourcemanager.azuredatatransfer.fluent.models.GetDestinationEndpointPortsResultInner + * object. + * + * @return the inner object. + */ + GetDestinationEndpointPortsResultInner innerModel(); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/GetDestinationEndpointsResult.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/GetDestinationEndpointsResult.java new file mode 100644 index 000000000000..ff9d7f2af6e5 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/GetDestinationEndpointsResult.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.azuredatatransfer.models; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.GetDestinationEndpointsResultInner; +import java.util.List; + +/** + * An immutable client-side representation of GetDestinationEndpointsResult. + */ +public interface GetDestinationEndpointsResult { + /** + * Gets the endpoints property: The destination endpoints for the flow stream. + * + * @return the endpoints value. + */ + List endpoints(); + + /** + * Gets the inner com.azure.resourcemanager.azuredatatransfer.fluent.models.GetDestinationEndpointsResultInner + * object. + * + * @return the inner object. + */ + GetDestinationEndpointsResultInner innerModel(); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/GetStreamConnectionStringResult.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/GetStreamConnectionStringResult.java new file mode 100644 index 000000000000..b97ce1b6a977 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/GetStreamConnectionStringResult.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.azuredatatransfer.models; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.GetStreamConnectionStringResultInner; + +/** + * An immutable client-side representation of GetStreamConnectionStringResult. + */ +public interface GetStreamConnectionStringResult { + /** + * Gets the connectionString property: The connection string for the specified streaming flow. + * + * @return the connectionString value. + */ + String connectionString(); + + /** + * Gets the inner com.azure.resourcemanager.azuredatatransfer.fluent.models.GetStreamConnectionStringResultInner + * object. + * + * @return the inner object. + */ + GetStreamConnectionStringResultInner innerModel(); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/IdentityTranslation.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/IdentityTranslation.java new file mode 100644 index 000000000000..3a3933374193 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/IdentityTranslation.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Flag for if Azure Data Transfer API Flow should extract the user token. + */ +public final class IdentityTranslation extends ExpandableStringEnum { + /** + * Static value UserIdentity for IdentityTranslation. + */ + public static final IdentityTranslation USER_IDENTITY = fromString("UserIdentity"); + + /** + * Static value ServiceIdentity for IdentityTranslation. + */ + public static final IdentityTranslation SERVICE_IDENTITY = fromString("ServiceIdentity"); + + /** + * Creates a new instance of IdentityTranslation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IdentityTranslation() { + } + + /** + * Creates or finds a IdentityTranslation from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityTranslation. + */ + public static IdentityTranslation fromString(String name) { + return fromString(name, IdentityTranslation.class); + } + + /** + * Gets known IdentityTranslation values. + * + * @return known IdentityTranslation values. + */ + public static Collection values() { + return values(IdentityTranslation.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/InternalMetadataProperties.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/InternalMetadataProperties.java new file mode 100644 index 000000000000..81659b08b780 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/InternalMetadataProperties.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Internal metadata of the connection inside pipeline. + */ +@Fluent +public final class InternalMetadataProperties implements JsonSerializable { + /* + * Operation status associated with the last patch request + */ + private OperationStatusProperties operationStatus; + + /* + * User that last set the approved status for this connection + */ + private String statusSetBy; + + /* + * Internal metadata of the connection inside pipeline. + */ + private Map additionalProperties; + + /** + * Creates an instance of InternalMetadataProperties class. + */ + public InternalMetadataProperties() { + } + + /** + * Get the operationStatus property: Operation status associated with the last patch request. + * + * @return the operationStatus value. + */ + public OperationStatusProperties operationStatus() { + return this.operationStatus; + } + + /** + * Set the operationStatus property: Operation status associated with the last patch request. + * + * @param operationStatus the operationStatus value to set. + * @return the InternalMetadataProperties object itself. + */ + public InternalMetadataProperties withOperationStatus(OperationStatusProperties operationStatus) { + this.operationStatus = operationStatus; + return this; + } + + /** + * Get the statusSetBy property: User that last set the approved status for this connection. + * + * @return the statusSetBy value. + */ + public String statusSetBy() { + return this.statusSetBy; + } + + /** + * Get the additionalProperties property: Internal metadata of the connection inside pipeline. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Internal metadata of the connection inside pipeline. + * + * @param additionalProperties the additionalProperties value to set. + * @return the InternalMetadataProperties object itself. + */ + public InternalMetadataProperties withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operationStatus() != null) { + operationStatus().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("operationStatus", this.operationStatus); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InternalMetadataProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InternalMetadataProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the InternalMetadataProperties. + */ + public static InternalMetadataProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InternalMetadataProperties deserializedInternalMetadataProperties = new InternalMetadataProperties(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationStatus".equals(fieldName)) { + deserializedInternalMetadataProperties.operationStatus = OperationStatusProperties.fromJson(reader); + } else if ("statusSetBy".equals(fieldName)) { + deserializedInternalMetadataProperties.statusSetBy = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedInternalMetadataProperties.additionalProperties = additionalProperties; + + return deserializedInternalMetadataProperties; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/LinkStatus.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/LinkStatus.java new file mode 100644 index 000000000000..2857b88257d8 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/LinkStatus.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Link status of the current pipeline, connection, flow. + */ +public final class LinkStatus extends ExpandableStringEnum { + /** + * Static value Linked for LinkStatus. + */ + public static final LinkStatus LINKED = fromString("Linked"); + + /** + * Static value Unlinked for LinkStatus. + */ + public static final LinkStatus UNLINKED = fromString("Unlinked"); + + /** + * Creates a new instance of LinkStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LinkStatus() { + } + + /** + * Creates or finds a LinkStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding LinkStatus. + */ + public static LinkStatus fromString(String name) { + return fromString(name, LinkStatus.class); + } + + /** + * Gets known LinkStatus values. + * + * @return known LinkStatus values. + */ + public static Collection values() { + return values(LinkStatus.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ListApprovedSchemasRequest.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ListApprovedSchemasRequest.java new file mode 100644 index 000000000000..d11ce288576e --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ListApprovedSchemasRequest.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The request used to list approved schemas within the resource provider. + */ +@Fluent +public final class ListApprovedSchemasRequest implements JsonSerializable { + /* + * The name of the pipeline to filter approved schemas. + */ + private String pipeline; + + /* + * The direction pipeline to filter approved schemas. + */ + private Direction direction; + + /** + * Creates an instance of ListApprovedSchemasRequest class. + */ + public ListApprovedSchemasRequest() { + } + + /** + * Get the pipeline property: The name of the pipeline to filter approved schemas. + * + * @return the pipeline value. + */ + public String pipeline() { + return this.pipeline; + } + + /** + * Set the pipeline property: The name of the pipeline to filter approved schemas. + * + * @param pipeline the pipeline value to set. + * @return the ListApprovedSchemasRequest object itself. + */ + public ListApprovedSchemasRequest withPipeline(String pipeline) { + this.pipeline = pipeline; + return this; + } + + /** + * Get the direction property: The direction pipeline to filter approved schemas. + * + * @return the direction value. + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction property: The direction pipeline to filter approved schemas. + * + * @param direction the direction value to set. + * @return the ListApprovedSchemasRequest object itself. + */ + public ListApprovedSchemasRequest withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pipeline", this.pipeline); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListApprovedSchemasRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListApprovedSchemasRequest if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListApprovedSchemasRequest. + */ + public static ListApprovedSchemasRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListApprovedSchemasRequest deserializedListApprovedSchemasRequest = new ListApprovedSchemasRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pipeline".equals(fieldName)) { + deserializedListApprovedSchemasRequest.pipeline = reader.getString(); + } else if ("direction".equals(fieldName)) { + deserializedListApprovedSchemasRequest.direction = Direction.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedListApprovedSchemasRequest; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ListFlowsByPipelineConnection.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ListFlowsByPipelineConnection.java new file mode 100644 index 000000000000..a8a1b477cebb --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ListFlowsByPipelineConnection.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.FlowInner; +import java.io.IOException; +import java.util.List; + +/** + * A connection resource id in addition to all child flow resources under this connection. + */ +@Fluent +public final class ListFlowsByPipelineConnection implements JsonSerializable { + /* + * ID of the connection. + */ + private String id; + + /* + * List of flows associated with the connection. + */ + private List flows; + + /** + * Creates an instance of ListFlowsByPipelineConnection class. + */ + public ListFlowsByPipelineConnection() { + } + + /** + * Get the id property: ID of the connection. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ID of the connection. + * + * @param id the id value to set. + * @return the ListFlowsByPipelineConnection object itself. + */ + public ListFlowsByPipelineConnection withId(String id) { + this.id = id; + return this; + } + + /** + * Get the flows property: List of flows associated with the connection. + * + * @return the flows value. + */ + public List flows() { + return this.flows; + } + + /** + * Set the flows property: List of flows associated with the connection. + * + * @param flows the flows value to set. + * @return the ListFlowsByPipelineConnection object itself. + */ + public ListFlowsByPipelineConnection withFlows(List flows) { + this.flows = flows; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (flows() != null) { + flows().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeArrayField("flows", this.flows, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListFlowsByPipelineConnection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListFlowsByPipelineConnection if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ListFlowsByPipelineConnection. + */ + public static ListFlowsByPipelineConnection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListFlowsByPipelineConnection deserializedListFlowsByPipelineConnection + = new ListFlowsByPipelineConnection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedListFlowsByPipelineConnection.id = reader.getString(); + } else if ("flows".equals(fieldName)) { + List flows = reader.readArray(reader1 -> FlowInner.fromJson(reader1)); + deserializedListFlowsByPipelineConnection.flows = flows; + } else { + reader.skipChildren(); + } + } + + return deserializedListFlowsByPipelineConnection; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ListFlowsByPipelineResult.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ListFlowsByPipelineResult.java new file mode 100644 index 000000000000..c53f405def2f --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ListFlowsByPipelineResult.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.azuredatatransfer.models; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ListFlowsByPipelineResultInner; +import java.util.List; + +/** + * An immutable client-side representation of ListFlowsByPipelineResult. + */ +public interface ListFlowsByPipelineResult { + /** + * Gets the value property: List flows by pipeline result by connection. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.azuredatatransfer.fluent.models.ListFlowsByPipelineResultInner object. + * + * @return the inner object. + */ + ListFlowsByPipelineResultInner innerModel(); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ManagedServiceIdentity.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..25d7c9563c65 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ManagedServiceIdentity.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; +import java.util.UUID; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will + * be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ManagedServiceIdentityType.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..91912fcdc378 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * Static value None for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/MessagingOptions.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/MessagingOptions.java new file mode 100644 index 000000000000..5dac7d48c8c8 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/MessagingOptions.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The option associated with messaging flows. + */ +@Fluent +public final class MessagingOptions implements JsonSerializable { + /* + * Billing tier for this messaging flow + */ + private FlowBillingTier billingTier; + + /** + * Creates an instance of MessagingOptions class. + */ + public MessagingOptions() { + } + + /** + * Get the billingTier property: Billing tier for this messaging flow. + * + * @return the billingTier value. + */ + public FlowBillingTier billingTier() { + return this.billingTier; + } + + /** + * Set the billingTier property: Billing tier for this messaging flow. + * + * @param billingTier the billingTier value to set. + * @return the MessagingOptions object itself. + */ + public MessagingOptions withBillingTier(FlowBillingTier billingTier) { + this.billingTier = billingTier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("billingTier", this.billingTier == null ? null : this.billingTier.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MessagingOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MessagingOptions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MessagingOptions. + */ + public static MessagingOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MessagingOptions deserializedMessagingOptions = new MessagingOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("billingTier".equals(fieldName)) { + deserializedMessagingOptions.billingTier = FlowBillingTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMessagingOptions; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Operation.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Operation.java new file mode 100644 index 000000000000..75ea2c4438c6 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.azuredatatransfer.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationDisplay.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationDisplay.java new file mode 100644 index 000000000000..a454c0c005e9 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationDisplay.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Localized display information for this particular operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + public OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationListResult.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationListResult.java new file mode 100644 index 000000000000..90db577b7b71 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationListResult.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * List of operations supported by the resource provider + */ + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationStatusEnum.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationStatusEnum.java new file mode 100644 index 000000000000..8c951ee04779 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationStatusEnum.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Operation status for the last patch request for this connection. + */ +public final class OperationStatusEnum extends ExpandableStringEnum { + /** + * Static value Failed for OperationStatusEnum. + */ + public static final OperationStatusEnum FAILED = fromString("Failed"); + + /** + * Static value Succeeded for OperationStatusEnum. + */ + public static final OperationStatusEnum SUCCEEDED = fromString("Succeeded"); + + /** + * Creates a new instance of OperationStatusEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperationStatusEnum() { + } + + /** + * Creates or finds a OperationStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationStatusEnum. + */ + public static OperationStatusEnum fromString(String name) { + return fromString(name, OperationStatusEnum.class); + } + + /** + * Gets known OperationStatusEnum values. + * + * @return known OperationStatusEnum values. + */ + public static Collection values() { + return values(OperationStatusEnum.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationStatusProperties.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationStatusProperties.java new file mode 100644 index 000000000000..b2a67bc54441 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/OperationStatusProperties.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Operation status associated with the last patch request. + */ +@Immutable +public final class OperationStatusProperties implements JsonSerializable { + /* + * Operation status for the last patch request for this connection. + */ + private OperationStatusEnum status; + + /* + * Operation status ID of the last patch request for this connection. + */ + private String id; + + /* + * Message for the operation for the last patch request for this connection. + */ + private String message; + + /** + * Creates an instance of OperationStatusProperties class. + */ + public OperationStatusProperties() { + } + + /** + * Get the status property: Operation status for the last patch request for this connection. + * + * @return the status value. + */ + public OperationStatusEnum status() { + return this.status; + } + + /** + * Get the id property: Operation status ID of the last patch request for this connection. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the message property: Message for the operation for the last patch request for this connection. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationStatusProperties. + */ + public static OperationStatusProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusProperties deserializedOperationStatusProperties = new OperationStatusProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedOperationStatusProperties.status = OperationStatusEnum.fromString(reader.getString()); + } else if ("id".equals(fieldName)) { + deserializedOperationStatusProperties.id = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedOperationStatusProperties.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusProperties; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Operations.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Operations.java new file mode 100644 index 000000000000..8de1a95c7c77 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Operations.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.azuredatatransfer.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Origin.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Origin.java new file mode 100644 index 000000000000..943fa6bfb907 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Origin.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Static value user for Origin. + */ + public static final Origin USER = fromString("user"); + + /** + * Static value system for Origin. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Static value user,system for Origin. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingConnection.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingConnection.java new file mode 100644 index 000000000000..fbf52940cee0 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingConnection.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PendingConnectionInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of PendingConnection. + */ +public interface PendingConnection { + /** + * Gets the pipeline property: Pipeline to use to transfer data. + * + * @return the pipeline value. + */ + String pipeline(); + + /** + * Gets the direction property: Direction of data movement. + * + * @return the direction value. + */ + Direction direction(); + + /** + * Gets the justification property: Justification for the connection request. + * + * @return the justification value. + */ + String justification(); + + /** + * Gets the status property: Status of the connection. + * + * @return the status value. + */ + ConnectionStatus status(); + + /** + * Gets the forceDisabledStatus property: Force disablement status of the current connection. + * + * @return the forceDisabledStatus value. + */ + List forceDisabledStatus(); + + /** + * Gets the statusReason property: Reason for status. + * + * @return the statusReason value. + */ + String statusReason(); + + /** + * Gets the linkStatus property: Link status of the current connection. + * + * @return the linkStatus value. + */ + LinkStatus linkStatus(); + + /** + * Gets the linkedConnectionId property: Resource ID of the linked connection. + * + * @return the linkedConnectionId value. + */ + String linkedConnectionId(); + + /** + * Gets the flowTypes property: The flow types being requested for this connection. + * + * @return the flowTypes value. + */ + List flowTypes(); + + /** + * Gets the requirementId property: Requirement ID of the connection. + * + * @return the requirementId value. + */ + String requirementId(); + + /** + * Gets the remoteSubscriptionId property: Subscription ID to link cloud subscriptions together. + * + * @return the remoteSubscriptionId value. + */ + String remoteSubscriptionId(); + + /** + * Gets the approver property: Approver of this connection request. + * + * @return the approver value. + */ + String approver(); + + /** + * Gets the pin property: PIN to link requests together. + * + * @return the pin value. + */ + String pin(); + + /** + * Gets the dateSubmitted property: The timestamp that this connection request was submitted at. + * + * @return the dateSubmitted value. + */ + OffsetDateTime dateSubmitted(); + + /** + * Gets the primaryContact property: The primary contact for this connection request. + * + * @return the primaryContact value. + */ + String primaryContact(); + + /** + * Gets the secondaryContacts property: The secondary contacts for this connection request. + * + * @return the secondaryContacts value. + */ + List secondaryContacts(); + + /** + * Gets the provisioningState property: Provisioning state of the connection. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the policies property: The policies for this connection. + * + * @return the policies value. + */ + List policies(); + + /** + * Gets the schemas property: The schemas for this connection. + * + * @return the schemas value. + */ + List schemas(); + + /** + * Gets the schemaUris property: The schema URIs for this connection. + * + * @return the schemaUris value. + */ + List schemaUris(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Connection properties(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + * + * @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. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts". + * + * @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 subscriptionId property: Subscription ID of the pending connection. + * + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * Gets the inner com.azure.resourcemanager.azuredatatransfer.fluent.models.PendingConnectionInner object. + * + * @return the inner object. + */ + PendingConnectionInner innerModel(); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingConnectionListResult.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingConnectionListResult.java new file mode 100644 index 000000000000..6351c788a6a4 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingConnectionListResult.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PendingConnectionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a PendingConnection list operation. + */ +@Fluent +public final class PendingConnectionListResult implements JsonSerializable { + /* + * The PendingConnection items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PendingConnectionListResult class. + */ + public PendingConnectionListResult() { + } + + /** + * Get the value property: The PendingConnection items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The PendingConnection items on this page. + * + * @param value the value value to set. + * @return the PendingConnectionListResult object itself. + */ + public PendingConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the PendingConnectionListResult object itself. + */ + public PendingConnectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model PendingConnectionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PendingConnectionListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PendingConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PendingConnectionListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PendingConnectionListResult. + */ + public static PendingConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PendingConnectionListResult deserializedPendingConnectionListResult = new PendingConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PendingConnectionInner.fromJson(reader1)); + deserializedPendingConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPendingConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPendingConnectionListResult; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingFlow.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingFlow.java new file mode 100644 index 000000000000..55ece66d3ad4 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingFlow.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PendingFlowInner; +import java.util.List; +import java.util.Map; + +/** + * An immutable client-side representation of PendingFlow. + */ +public interface PendingFlow { + /** + * Gets the connection property: The connection associated with this flow. + * + * @return the connection value. + */ + SelectedResource connection(); + + /** + * Gets the flowId property: Dataflow GUID associated with this flow. + * + * @return the flowId value. + */ + String flowId(); + + /** + * Gets the keyVaultUri property: AME, PME, or TORUS only! AKV Chain Containing SAS Token. + * + * @return the keyVaultUri value. + */ + String keyVaultUri(); + + /** + * Gets the linkStatus property: Link status of the current flow. + * + * @return the linkStatus value. + */ + LinkStatus linkStatus(); + + /** + * Gets the linkedFlowId property: Resource ID of the linked flow. + * + * @return the linkedFlowId value. + */ + String linkedFlowId(); + + /** + * Gets the status property: Status of the current flow. + * + * @return the status value. + */ + FlowStatus status(); + + /** + * Gets the forceDisabledStatus property: Force disablement status of the current flow. + * + * @return the forceDisabledStatus value. + */ + List forceDisabledStatus(); + + /** + * Gets the storageAccountName property: Storage Account. + * + * @return the storageAccountName value. + */ + String storageAccountName(); + + /** + * Gets the storageAccountId property: Storage Account ID. + * + * @return the storageAccountId value. + */ + String storageAccountId(); + + /** + * Gets the storageContainerName property: Storage Container Name. + * + * @return the storageContainerName value. + */ + String storageContainerName(); + + /** + * Gets the storageTableName property: Storage Table Name. + * + * @return the storageTableName value. + */ + String storageTableName(); + + /** + * Gets the serviceBusQueueId property: Service Bus Queue ID. + * + * @return the serviceBusQueueId value. + */ + String serviceBusQueueId(); + + /** + * Gets the flowType property: The flow type for this flow. + * + * @return the flowType value. + */ + FlowType flowType(); + + /** + * Gets the dataType property: Transfer Storage Blobs or Tables. + * + * @return the dataType value. + */ + DataType dataType(); + + /** + * Gets the provisioningState property: Provisioning state of the flow. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the policies property: The policies for this flow. + * + * @return the policies value. + */ + List policies(); + + /** + * Gets the schema property: The selected schema for this flow. + * + * @return the schema value. + */ + Schema schema(); + + /** + * Gets the messagingOptions property: The messaging options for this flow. + * + * @return the messagingOptions value. + */ + MessagingOptions messagingOptions(); + + /** + * Gets the apiFlowOptions property: The API Flow configuration options for Azure Data Transfer API Flow type. + * + * @return the apiFlowOptions value. + */ + ApiFlowOptions apiFlowOptions(); + + /** + * Gets the customerManagedKeyVaultUri property: The URI to the customer managed key for this flow. + * + * @return the customerManagedKeyVaultUri value. + */ + String customerManagedKeyVaultUri(); + + /** + * Gets the streamId property: The flow stream identifier. + * + * @return the streamId value. + */ + String streamId(); + + /** + * Gets the streamProtocol property: The protocol of the stream. + * + * @return the streamProtocol value. + */ + StreamProtocol streamProtocol(); + + /** + * Gets the streamLatency property: The latency of the stream in milliseconds. + * + * @return the streamLatency value. + */ + Long streamLatency(); + + /** + * Gets the passphrase property: The passphrase used for SRT streams. + * + * @return the passphrase value. + */ + String passphrase(); + + /** + * Gets the sourceAddresses property: The source IP address and CIDR ranges of the stream. + * + * @return the sourceAddresses value. + */ + StreamSourceAddresses sourceAddresses(); + + /** + * Gets the destinationEndpoints property: The destination endpoints of the stream. + * + * @return the destinationEndpoints value. + */ + List destinationEndpoints(); + + /** + * Gets the destinationEndpointPorts property: The destination endpoint ports of the stream. + * + * @return the destinationEndpointPorts value. + */ + List destinationEndpointPorts(); + + /** + * Gets the eventHubId property: Event Hub ID. + * + * @return the eventHubId value. + */ + String eventHubId(); + + /** + * Gets the consumerGroup property: Event Hub Consumer Group. + * + * @return the consumerGroup value. + */ + String consumerGroup(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + Flow properties(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the id property: Fully qualified resource ID for the resource. Ex - + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + * + * @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. E.g. "Microsoft.Compute/virtualMachines" or + * "Microsoft.Storage/storageAccounts". + * + * @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 subscriptionId property: Subscription ID of the pending flow. + * + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * Gets the connectionId property: Connection ID of the pending flow. + * + * @return the connectionId value. + */ + String connectionId(); + + /** + * Gets the inner com.azure.resourcemanager.azuredatatransfer.fluent.models.PendingFlowInner object. + * + * @return the inner object. + */ + PendingFlowInner innerModel(); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingFlowListResult.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingFlowListResult.java new file mode 100644 index 000000000000..cfb75493eb15 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PendingFlowListResult.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.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PendingFlowInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a PendingFlow list operation. + */ +@Fluent +public final class PendingFlowListResult implements JsonSerializable { + /* + * The PendingFlow items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PendingFlowListResult class. + */ + public PendingFlowListResult() { + } + + /** + * Get the value property: The PendingFlow items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The PendingFlow items on this page. + * + * @param value the value value to set. + * @return the PendingFlowListResult object itself. + */ + public PendingFlowListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the PendingFlowListResult object itself. + */ + public PendingFlowListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model PendingFlowListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PendingFlowListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PendingFlowListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PendingFlowListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PendingFlowListResult. + */ + public static PendingFlowListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PendingFlowListResult deserializedPendingFlowListResult = new PendingFlowListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> PendingFlowInner.fromJson(reader1)); + deserializedPendingFlowListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPendingFlowListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPendingFlowListResult; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Pipeline.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Pipeline.java new file mode 100644 index 000000000000..f0effb21b989 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Pipeline.java @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PipelineInner; +import java.util.Map; + +/** + * An immutable client-side representation of Pipeline. + */ +public interface Pipeline { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: Properties of pipeline. + * + * @return the properties value. + */ + PipelineProperties properties(); + + /** + * Gets the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.azuredatatransfer.fluent.models.PipelineInner object. + * + * @return the inner object. + */ + PipelineInner innerModel(); + + /** + * The entirety of the Pipeline definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Pipeline definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Pipeline definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Pipeline definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Pipeline 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 Pipeline definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithProperties, DefinitionStages.WithIdentity { + /** + * Executes the create request. + * + * @return the created resource. + */ + Pipeline create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Pipeline create(Context context); + } + + /** + * The stage of the Pipeline definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Pipeline definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of pipeline. + * + * @param properties Properties of pipeline. + * @return the next definition stage. + */ + WithCreate withProperties(PipelineProperties properties); + } + + /** + * The stage of the Pipeline definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + } + + /** + * Begins update for the Pipeline resource. + * + * @return the stage of resource update. + */ + Pipeline.Update update(); + + /** + * The template for Pipeline update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Pipeline apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Pipeline apply(Context context); + } + + /** + * The Pipeline update stages. + */ + interface UpdateStages { + /** + * The stage of the Pipeline update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the Pipeline update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of pipelines patch body.. + * + * @param properties Properties of pipelines patch body. + * @return the next definition stage. + */ + Update withProperties(PipelinesPatchProperties properties); + } + + /** + * The stage of the Pipeline update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Pipeline refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Pipeline refresh(Context context); + + /** + * Approves the specified connection in a pipeline. + * + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + Connection approveConnection(ResourceBody body); + + /** + * Approves the specified connection in a pipeline. + * + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + Connection approveConnection(ResourceBody body, Context context); + + /** + * Executes a privileged action for a pipeline. + * + * @param body Action to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + Pipeline executeAction(Action body); + + /** + * Executes a privileged action for a pipeline. + * + * @param body Action to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + Pipeline executeAction(Action body, Context context); + + /** + * Lists the flows in a pipeline. + * + * @param connections Connection(s) to retrieve flows of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of flow resources along with {@link Response}. + */ + Response listWithResponse(ConnectionIdList connections, Context context); + + /** + * Lists the flows in a pipeline. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of flow resources. + */ + ListFlowsByPipelineResult list(); + + /** + * Lists the schemas for the specified connection in a pipeline. + * + * @param body Schema(s) to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result along with {@link Response}. + */ + Response listSchemasListWithResponse(Schema body, Context context); + + /** + * Lists the schemas for the specified connection in a pipeline. + * + * @param body Schema(s) to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result. + */ + SchemasListResult listSchemasList(Schema body); + + /** + * Rejects the specified connection in a pipeline. + * + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + Connection rejectConnection(ResourceBody body); + + /** + * Rejects the specified connection in a pipeline. + * + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + Connection rejectConnection(ResourceBody body, Context context); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineConnection.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineConnection.java new file mode 100644 index 000000000000..37dd1c275626 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineConnection.java @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Connection body inside a pipeline. + */ +@Fluent +public final class PipelineConnection implements JsonSerializable { + /* + * Connection id inside pipeline + */ + private String id; + + /* + * Connection name inside pipeline + */ + private String name; + + /* + * Connection type inside pipeline + */ + private String type; + + /* + * Connection location inside pipeline + */ + private String location; + + /* + * Connection etag inside pipeline + */ + private String etag; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + private SystemData systemData; + + /* + * Connection properties inside pipeline + */ + private PipelineConnectionProperties properties; + + /* + * Connection body inside a pipeline + */ + private Map additionalProperties; + + /** + * Creates an instance of PipelineConnection class. + */ + public PipelineConnection() { + } + + /** + * Get the id property: Connection id inside pipeline. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Connection id inside pipeline. + * + * @param id the id value to set. + * @return the PipelineConnection object itself. + */ + public PipelineConnection withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Connection name inside pipeline. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Connection type inside pipeline. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the location property: Connection location inside pipeline. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the etag property: Connection etag inside pipeline. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the properties property: Connection properties inside pipeline. + * + * @return the properties value. + */ + public PipelineConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Connection properties inside pipeline. + * + * @param properties the properties value to set. + * @return the PipelineConnection object itself. + */ + public PipelineConnection withProperties(PipelineConnectionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the additionalProperties property: Connection body inside a pipeline. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Connection body inside a pipeline. + * + * @param additionalProperties the additionalProperties value to set. + * @return the PipelineConnection object itself. + */ + public PipelineConnection withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model PipelineConnection")); + } + if (properties() != null) { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PipelineConnection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("properties", this.properties); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PipelineConnection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PipelineConnection if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PipelineConnection. + */ + public static PipelineConnection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PipelineConnection deserializedPipelineConnection = new PipelineConnection(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPipelineConnection.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPipelineConnection.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPipelineConnection.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPipelineConnection.location = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedPipelineConnection.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedPipelineConnection.systemData = SystemData.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedPipelineConnection.properties = PipelineConnectionProperties.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedPipelineConnection.additionalProperties = additionalProperties; + + return deserializedPipelineConnection; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineConnectionProperties.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineConnectionProperties.java new file mode 100644 index 000000000000..79e4ab51fa6b --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineConnectionProperties.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Connection properties inside pipeline. + */ +@Fluent +public final class PipelineConnectionProperties implements JsonSerializable { + /* + * Internal metadata of the connection inside pipeline. + */ + private InternalMetadataProperties internalMetadata; + + /* + * Connection properties inside pipeline + */ + private Map additionalProperties; + + /** + * Creates an instance of PipelineConnectionProperties class. + */ + public PipelineConnectionProperties() { + } + + /** + * Get the internalMetadata property: Internal metadata of the connection inside pipeline. + * + * @return the internalMetadata value. + */ + public InternalMetadataProperties internalMetadata() { + return this.internalMetadata; + } + + /** + * Set the internalMetadata property: Internal metadata of the connection inside pipeline. + * + * @param internalMetadata the internalMetadata value to set. + * @return the PipelineConnectionProperties object itself. + */ + public PipelineConnectionProperties withInternalMetadata(InternalMetadataProperties internalMetadata) { + this.internalMetadata = internalMetadata; + return this; + } + + /** + * Get the additionalProperties property: Connection properties inside pipeline. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Connection properties inside pipeline. + * + * @param additionalProperties the additionalProperties value to set. + * @return the PipelineConnectionProperties object itself. + */ + public PipelineConnectionProperties withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (internalMetadata() != null) { + internalMetadata().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("internalMetadata", this.internalMetadata); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PipelineConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PipelineConnectionProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PipelineConnectionProperties. + */ + public static PipelineConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PipelineConnectionProperties deserializedPipelineConnectionProperties = new PipelineConnectionProperties(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("internalMetadata".equals(fieldName)) { + deserializedPipelineConnectionProperties.internalMetadata + = InternalMetadataProperties.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedPipelineConnectionProperties.additionalProperties = additionalProperties; + + return deserializedPipelineConnectionProperties; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineListResult.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineListResult.java new file mode 100644 index 000000000000..d6a7cb6a971c --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineListResult.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.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.azuredatatransfer.fluent.models.PipelineInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a Pipeline list operation. + */ +@Fluent +public final class PipelineListResult implements JsonSerializable { + /* + * The Pipeline items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PipelineListResult class. + */ + public PipelineListResult() { + } + + /** + * Get the value property: The Pipeline items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The Pipeline items on this page. + * + * @param value the value value to set. + * @return the PipelineListResult object itself. + */ + public PipelineListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the PipelineListResult object itself. + */ + public PipelineListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model PipelineListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PipelineListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PipelineListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PipelineListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PipelineListResult. + */ + public static PipelineListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PipelineListResult deserializedPipelineListResult = new PipelineListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> PipelineInner.fromJson(reader1)); + deserializedPipelineListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPipelineListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPipelineListResult; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineProperties.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineProperties.java new file mode 100644 index 000000000000..122df7477874 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineProperties.java @@ -0,0 +1,373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of pipeline. + */ +@Fluent +public final class PipelineProperties implements JsonSerializable { + /* + * Remote cloud of the data to be transferred or received + */ + private String remoteCloud; + + /* + * Display name of this pipeline + */ + private String displayName; + + /* + * Connections associated with pipeline + */ + private List connections; + + /* + * Subscribers of this resource + */ + private List subscribers; + + /* + * Provisioning state of the pipeline + */ + private ProvisioningState provisioningState; + + /* + * The policies for this pipeline + */ + private List policies; + + /* + * The flow types allowed for this pipeline + */ + private List flowTypes; + + /* + * The flow types that are disabled for this pipeline + */ + private List disabledFlowTypes; + + /* + * Quarantine Download Storage Account + */ + private String quarantineDownloadStorageAccount; + + /* + * Quarantine Download Storage Container + */ + private String quarantineDownloadStorageContainer; + + /* + * Status of the current pipeline + */ + private PipelineStatus status; + + /** + * Creates an instance of PipelineProperties class. + */ + public PipelineProperties() { + } + + /** + * Get the remoteCloud property: Remote cloud of the data to be transferred or received. + * + * @return the remoteCloud value. + */ + public String remoteCloud() { + return this.remoteCloud; + } + + /** + * Set the remoteCloud property: Remote cloud of the data to be transferred or received. + * + * @param remoteCloud the remoteCloud value to set. + * @return the PipelineProperties object itself. + */ + public PipelineProperties withRemoteCloud(String remoteCloud) { + this.remoteCloud = remoteCloud; + return this; + } + + /** + * Get the displayName property: Display name of this pipeline. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Display name of this pipeline. + * + * @param displayName the displayName value to set. + * @return the PipelineProperties object itself. + */ + public PipelineProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the connections property: Connections associated with pipeline. + * + * @return the connections value. + */ + public List connections() { + return this.connections; + } + + /** + * Get the subscribers property: Subscribers of this resource. + * + * @return the subscribers value. + */ + public List subscribers() { + return this.subscribers; + } + + /** + * Set the subscribers property: Subscribers of this resource. + * + * @param subscribers the subscribers value to set. + * @return the PipelineProperties object itself. + */ + public PipelineProperties withSubscribers(List subscribers) { + this.subscribers = subscribers; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the pipeline. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the policies property: The policies for this pipeline. + * + * @return the policies value. + */ + public List policies() { + return this.policies; + } + + /** + * Set the policies property: The policies for this pipeline. + * + * @param policies the policies value to set. + * @return the PipelineProperties object itself. + */ + public PipelineProperties withPolicies(List policies) { + this.policies = policies; + return this; + } + + /** + * Get the flowTypes property: The flow types allowed for this pipeline. + * + * @return the flowTypes value. + */ + public List flowTypes() { + return this.flowTypes; + } + + /** + * Set the flowTypes property: The flow types allowed for this pipeline. + * + * @param flowTypes the flowTypes value to set. + * @return the PipelineProperties object itself. + */ + public PipelineProperties withFlowTypes(List flowTypes) { + this.flowTypes = flowTypes; + return this; + } + + /** + * Get the disabledFlowTypes property: The flow types that are disabled for this pipeline. + * + * @return the disabledFlowTypes value. + */ + public List disabledFlowTypes() { + return this.disabledFlowTypes; + } + + /** + * Set the disabledFlowTypes property: The flow types that are disabled for this pipeline. + * + * @param disabledFlowTypes the disabledFlowTypes value to set. + * @return the PipelineProperties object itself. + */ + public PipelineProperties withDisabledFlowTypes(List disabledFlowTypes) { + this.disabledFlowTypes = disabledFlowTypes; + return this; + } + + /** + * Get the quarantineDownloadStorageAccount property: Quarantine Download Storage Account. + * + * @return the quarantineDownloadStorageAccount value. + */ + public String quarantineDownloadStorageAccount() { + return this.quarantineDownloadStorageAccount; + } + + /** + * Set the quarantineDownloadStorageAccount property: Quarantine Download Storage Account. + * + * @param quarantineDownloadStorageAccount the quarantineDownloadStorageAccount value to set. + * @return the PipelineProperties object itself. + */ + public PipelineProperties withQuarantineDownloadStorageAccount(String quarantineDownloadStorageAccount) { + this.quarantineDownloadStorageAccount = quarantineDownloadStorageAccount; + return this; + } + + /** + * Get the quarantineDownloadStorageContainer property: Quarantine Download Storage Container. + * + * @return the quarantineDownloadStorageContainer value. + */ + public String quarantineDownloadStorageContainer() { + return this.quarantineDownloadStorageContainer; + } + + /** + * Set the quarantineDownloadStorageContainer property: Quarantine Download Storage Container. + * + * @param quarantineDownloadStorageContainer the quarantineDownloadStorageContainer value to set. + * @return the PipelineProperties object itself. + */ + public PipelineProperties withQuarantineDownloadStorageContainer(String quarantineDownloadStorageContainer) { + this.quarantineDownloadStorageContainer = quarantineDownloadStorageContainer; + return this; + } + + /** + * Get the status property: Status of the current pipeline. + * + * @return the status value. + */ + public PipelineStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the current pipeline. + * + * @param status the status value to set. + * @return the PipelineProperties object itself. + */ + public PipelineProperties withStatus(PipelineStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (remoteCloud() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property remoteCloud in model PipelineProperties")); + } + if (connections() != null) { + connections().forEach(e -> e.validate()); + } + if (subscribers() != null) { + subscribers().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PipelineProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("remoteCloud", this.remoteCloud); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeArrayField("subscribers", this.subscribers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("policies", this.policies, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("flowTypes", this.flowTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("disabledFlowTypes", this.disabledFlowTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("quarantineDownloadStorageAccount", this.quarantineDownloadStorageAccount); + jsonWriter.writeStringField("quarantineDownloadStorageContainer", this.quarantineDownloadStorageContainer); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PipelineProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PipelineProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PipelineProperties. + */ + public static PipelineProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PipelineProperties deserializedPipelineProperties = new PipelineProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("remoteCloud".equals(fieldName)) { + deserializedPipelineProperties.remoteCloud = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedPipelineProperties.displayName = reader.getString(); + } else if ("connections".equals(fieldName)) { + List connections + = reader.readArray(reader1 -> PipelineConnection.fromJson(reader1)); + deserializedPipelineProperties.connections = connections; + } else if ("subscribers".equals(fieldName)) { + List subscribers = reader.readArray(reader1 -> Subscriber.fromJson(reader1)); + deserializedPipelineProperties.subscribers = subscribers; + } else if ("provisioningState".equals(fieldName)) { + deserializedPipelineProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else if ("policies".equals(fieldName)) { + List policies = reader.readArray(reader1 -> reader1.getString()); + deserializedPipelineProperties.policies = policies; + } else if ("flowTypes".equals(fieldName)) { + List flowTypes = reader.readArray(reader1 -> FlowType.fromString(reader1.getString())); + deserializedPipelineProperties.flowTypes = flowTypes; + } else if ("disabledFlowTypes".equals(fieldName)) { + List disabledFlowTypes + = reader.readArray(reader1 -> FlowType.fromString(reader1.getString())); + deserializedPipelineProperties.disabledFlowTypes = disabledFlowTypes; + } else if ("quarantineDownloadStorageAccount".equals(fieldName)) { + deserializedPipelineProperties.quarantineDownloadStorageAccount = reader.getString(); + } else if ("quarantineDownloadStorageContainer".equals(fieldName)) { + deserializedPipelineProperties.quarantineDownloadStorageContainer = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedPipelineProperties.status = PipelineStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPipelineProperties; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineStatus.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineStatus.java new file mode 100644 index 000000000000..0bc476fcc279 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelineStatus.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the current pipeline. + */ +public final class PipelineStatus extends ExpandableStringEnum { + /** + * Static value Enabled for PipelineStatus. + */ + public static final PipelineStatus ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for PipelineStatus. + */ + public static final PipelineStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PipelineStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PipelineStatus() { + } + + /** + * Creates or finds a PipelineStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PipelineStatus. + */ + public static PipelineStatus fromString(String name) { + return fromString(name, PipelineStatus.class); + } + + /** + * Gets known PipelineStatus values. + * + * @return known PipelineStatus values. + */ + public static Collection values() { + return values(PipelineStatus.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Pipelines.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Pipelines.java new file mode 100644 index 000000000000..99d35224b144 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Pipelines.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.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 Pipelines. + */ +public interface Pipelines { + /** + * Gets pipelines in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscription(); + + /** + * Gets pipelines in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscription(Context context); + + /** + * Gets pipelines in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets pipelines in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipelines in a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipeline resource along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String pipelineName, Context context); + + /** + * Gets pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipeline resource. + */ + Pipeline getByResourceGroup(String resourceGroupName, String pipelineName); + + /** + * Deletes the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String pipelineName); + + /** + * Deletes the pipeline resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String pipelineName, Context context); + + /** + * Approves the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + Connection approveConnection(String resourceGroupName, String pipelineName, ResourceBody body); + + /** + * Approves the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + Connection approveConnection(String resourceGroupName, String pipelineName, ResourceBody body, Context context); + + /** + * Executes a privileged action for a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Action to execute. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + Pipeline executeAction(String resourceGroupName, String pipelineName, Action body); + + /** + * Executes a privileged action for a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Action to execute. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the pipeline resource definition. + */ + Pipeline executeAction(String resourceGroupName, String pipelineName, Action body, Context context); + + /** + * Lists the flows in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param connections Connection(s) to retrieve flows of. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of flow resources along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, String pipelineName, + ConnectionIdList connections, Context context); + + /** + * Lists the flows in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an array of flow resources. + */ + ListFlowsByPipelineResult list(String resourceGroupName, String pipelineName); + + /** + * Lists the schemas for the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Schema(s) to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result along with {@link Response}. + */ + Response listSchemasListWithResponse(String resourceGroupName, String pipelineName, Schema body, + Context context); + + /** + * Lists the schemas for the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Schema(s) to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the schemas list result. + */ + SchemasListResult listSchemasList(String resourceGroupName, String pipelineName, Schema body); + + /** + * Rejects the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + Connection rejectConnection(String resourceGroupName, String pipelineName, ResourceBody body); + + /** + * Rejects the specified connection in a pipeline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param pipelineName The name for the pipeline that is to be requested. + * @param body Connection body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the connection resource definition. + */ + Connection rejectConnection(String resourceGroupName, String pipelineName, ResourceBody body, Context context); + + /** + * Gets pipeline resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipeline resource along with {@link Response}. + */ + Pipeline getById(String id); + + /** + * Gets pipeline resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return pipeline resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the pipeline resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the pipeline resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Pipeline resource. + * + * @param name resource name. + * @return the first stage of the new Pipeline definition. + */ + Pipeline.DefinitionStages.Blank define(String name); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelinesPatch.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelinesPatch.java new file mode 100644 index 000000000000..1e3ea294fca6 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelinesPatch.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The pipelines resource patch definition. + */ +@Fluent +public final class PipelinesPatch implements JsonSerializable { + /* + * Properties of pipelines patch body. + */ + private PipelinesPatchProperties properties; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /** + * Creates an instance of PipelinesPatch class. + */ + public PipelinesPatch() { + } + + /** + * Get the properties property: Properties of pipelines patch body. + * + * @return the properties value. + */ + public PipelinesPatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of pipelines patch body. + * + * @param properties the properties value to set. + * @return the PipelinesPatch object itself. + */ + public PipelinesPatch withProperties(PipelinesPatchProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the PipelinesPatch object itself. + */ + public PipelinesPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the PipelinesPatch object itself. + */ + public PipelinesPatch withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PipelinesPatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PipelinesPatch if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PipelinesPatch. + */ + public static PipelinesPatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PipelinesPatch deserializedPipelinesPatch = new PipelinesPatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedPipelinesPatch.properties = PipelinesPatchProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPipelinesPatch.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedPipelinesPatch.identity = ManagedServiceIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPipelinesPatch; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelinesPatchProperties.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelinesPatchProperties.java new file mode 100644 index 000000000000..c76da81b8f78 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/PipelinesPatchProperties.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of pipelines patch body. + */ +@Fluent +public final class PipelinesPatchProperties implements JsonSerializable { + /* + * Connections associated with pipeline + */ + private List connections; + + /* + * The flow types allowed for this pipeline + */ + private List flowTypes; + + /** + * Creates an instance of PipelinesPatchProperties class. + */ + public PipelinesPatchProperties() { + } + + /** + * Get the connections property: Connections associated with pipeline. + * + * @return the connections value. + */ + public List connections() { + return this.connections; + } + + /** + * Set the connections property: Connections associated with pipeline. + * + * @param connections the connections value to set. + * @return the PipelinesPatchProperties object itself. + */ + public PipelinesPatchProperties withConnections(List connections) { + this.connections = connections; + return this; + } + + /** + * Get the flowTypes property: The flow types allowed for this pipeline. + * + * @return the flowTypes value. + */ + public List flowTypes() { + return this.flowTypes; + } + + /** + * Set the flowTypes property: The flow types allowed for this pipeline. + * + * @param flowTypes the flowTypes value to set. + * @return the PipelinesPatchProperties object itself. + */ + public PipelinesPatchProperties withFlowTypes(List flowTypes) { + this.flowTypes = flowTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connections() != null) { + connections().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("connections", this.connections, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("flowTypes", this.flowTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PipelinesPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PipelinesPatchProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PipelinesPatchProperties. + */ + public static PipelinesPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PipelinesPatchProperties deserializedPipelinesPatchProperties = new PipelinesPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connections".equals(fieldName)) { + List connections + = reader.readArray(reader1 -> PipelineConnection.fromJson(reader1)); + deserializedPipelinesPatchProperties.connections = connections; + } else if ("flowTypes".equals(fieldName)) { + List flowTypes = reader.readArray(reader1 -> FlowType.fromString(reader1.getString())); + deserializedPipelinesPatchProperties.flowTypes = flowTypes; + } else { + reader.skipChildren(); + } + } + + return deserializedPipelinesPatchProperties; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Plan.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Plan.java new file mode 100644 index 000000000000..0c8a69484cac --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Plan.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Plan for the resource. + */ +@Fluent +public final class Plan implements JsonSerializable { + /* + * A user defined name of the 3rd Party Artifact that is being procured. + */ + private String name; + + /* + * The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic + */ + private String publisher; + + /* + * The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the + * artifact at the time of Data Market onboarding. + */ + private String product; + + /* + * A publisher provided promotion code as provisioned in Data Market for the said product/artifact. + */ + private String promotionCode; + + /* + * The version of the desired product/artifact. + */ + private String version; + + /** + * Creates an instance of Plan class. + */ + public Plan() { + } + + /** + * Get the name property: A user defined name of the 3rd Party Artifact that is being procured. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A user defined name of the 3rd Party Artifact that is being procured. + * + * @param name the name value to set. + * @return the Plan object itself. + */ + public Plan withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher property: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic. + * + * @param publisher the publisher value to set. + * @return the Plan object itself. + */ + public Plan withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the product property: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the + * OfferID specified for the artifact at the time of Data Market onboarding. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the + * OfferID specified for the artifact at the time of Data Market onboarding. + * + * @param product the product value to set. + * @return the Plan object itself. + */ + public Plan withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get the promotionCode property: A publisher provided promotion code as provisioned in Data Market for the said + * product/artifact. + * + * @return the promotionCode value. + */ + public String promotionCode() { + return this.promotionCode; + } + + /** + * Set the promotionCode property: A publisher provided promotion code as provisioned in Data Market for the said + * product/artifact. + * + * @param promotionCode the promotionCode value to set. + * @return the Plan object itself. + */ + public Plan withPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** + * Get the version property: The version of the desired product/artifact. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the desired product/artifact. + * + * @param version the version value to set. + * @return the Plan object itself. + */ + public Plan withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Plan")); + } + if (publisher() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property publisher in model Plan")); + } + if (product() == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property product in model Plan")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Plan.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("publisher", this.publisher); + jsonWriter.writeStringField("product", this.product); + jsonWriter.writeStringField("promotionCode", this.promotionCode); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Plan from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Plan if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Plan. + */ + public static Plan fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Plan deserializedPlan = new Plan(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedPlan.name = reader.getString(); + } else if ("publisher".equals(fieldName)) { + deserializedPlan.publisher = reader.getString(); + } else if ("product".equals(fieldName)) { + deserializedPlan.product = reader.getString(); + } else if ("promotionCode".equals(fieldName)) { + deserializedPlan.promotionCode = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedPlan.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPlan; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ProvisioningState.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ProvisioningState.java new file mode 100644 index 000000000000..d0ebef16758d --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ProvisioningState.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of the pipeline, connection, flow. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for ProvisioningState. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ProvisioningState. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ProvisioningState. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Accepted for ProvisioningState. + */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ResourceBody.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ResourceBody.java new file mode 100644 index 000000000000..c3daacc0b2ab --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ResourceBody.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The resource to reference. + */ +@Fluent +public final class ResourceBody implements JsonSerializable { + /* + * ID of the resource. + */ + private String id; + + /* + * Reason for resource operation. + */ + private String statusReason; + + /** + * Creates an instance of ResourceBody class. + */ + public ResourceBody() { + } + + /** + * Get the id property: ID of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ID of the resource. + * + * @param id the id value to set. + * @return the ResourceBody object itself. + */ + public ResourceBody withId(String id) { + this.id = id; + return this; + } + + /** + * Get the statusReason property: Reason for resource operation. + * + * @return the statusReason value. + */ + public String statusReason() { + return this.statusReason; + } + + /** + * Set the statusReason property: Reason for resource operation. + * + * @param statusReason the statusReason value to set. + * @return the ResourceBody object itself. + */ + public ResourceBody withStatusReason(String statusReason) { + this.statusReason = statusReason; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model ResourceBody")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ResourceBody.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("statusReason", this.statusReason); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceBody if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ResourceBody. + */ + public static ResourceBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceBody deserializedResourceBody = new ResourceBody(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedResourceBody.id = reader.getString(); + } else if ("statusReason".equals(fieldName)) { + deserializedResourceBody.statusReason = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceBody; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Schema.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Schema.java new file mode 100644 index 000000000000..20940aa1adda --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Schema.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The schema object. + */ +@Fluent +public final class Schema implements JsonSerializable { + /* + * ID associated with this schema + */ + private String id; + + /* + * Connection ID associated with this schema + */ + private String connectionId; + + /* + * Status of the schema + */ + private SchemaStatus status; + + /* + * Name of the schema + */ + private String name; + + /* + * Content of the schema + */ + private String content; + + /* + * The direction of the schema. + */ + private Direction direction; + + /* + * Uri containing SAS token for the zipped schema + */ + private String schemaUri; + + /* + * The Schema Type + */ + private SchemaType schemaType; + + /** + * Creates an instance of Schema class. + */ + public Schema() { + } + + /** + * Get the id property: ID associated with this schema. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: ID associated with this schema. + * + * @param id the id value to set. + * @return the Schema object itself. + */ + public Schema withId(String id) { + this.id = id; + return this; + } + + /** + * Get the connectionId property: Connection ID associated with this schema. + * + * @return the connectionId value. + */ + public String connectionId() { + return this.connectionId; + } + + /** + * Set the connectionId property: Connection ID associated with this schema. + * + * @param connectionId the connectionId value to set. + * @return the Schema object itself. + */ + public Schema withConnectionId(String connectionId) { + this.connectionId = connectionId; + return this; + } + + /** + * Get the status property: Status of the schema. + * + * @return the status value. + */ + public SchemaStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the schema. + * + * @param status the status value to set. + * @return the Schema object itself. + */ + public Schema withStatus(SchemaStatus status) { + this.status = status; + return this; + } + + /** + * Get the name property: Name of the schema. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the schema. + * + * @param name the name value to set. + * @return the Schema object itself. + */ + public Schema withName(String name) { + this.name = name; + return this; + } + + /** + * Get the content property: Content of the schema. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: Content of the schema. + * + * @param content the content value to set. + * @return the Schema object itself. + */ + public Schema withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the direction property: The direction of the schema. + * + * @return the direction value. + */ + public Direction direction() { + return this.direction; + } + + /** + * Set the direction property: The direction of the schema. + * + * @param direction the direction value to set. + * @return the Schema object itself. + */ + public Schema withDirection(Direction direction) { + this.direction = direction; + return this; + } + + /** + * Get the schemaUri property: Uri containing SAS token for the zipped schema. + * + * @return the schemaUri value. + */ + public String schemaUri() { + return this.schemaUri; + } + + /** + * Set the schemaUri property: Uri containing SAS token for the zipped schema. + * + * @param schemaUri the schemaUri value to set. + * @return the Schema object itself. + */ + public Schema withSchemaUri(String schemaUri) { + this.schemaUri = schemaUri; + return this; + } + + /** + * Get the schemaType property: The Schema Type. + * + * @return the schemaType value. + */ + public SchemaType schemaType() { + return this.schemaType; + } + + /** + * Set the schemaType property: The Schema Type. + * + * @param schemaType the schemaType value to set. + * @return the Schema object itself. + */ + public Schema withSchemaType(SchemaType schemaType) { + this.schemaType = schemaType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("connectionId", this.connectionId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + jsonWriter.writeStringField("schemaUri", this.schemaUri); + jsonWriter.writeStringField("schemaType", this.schemaType == null ? null : this.schemaType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Schema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Schema if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Schema. + */ + public static Schema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Schema deserializedSchema = new Schema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSchema.id = reader.getString(); + } else if ("connectionId".equals(fieldName)) { + deserializedSchema.connectionId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedSchema.status = SchemaStatus.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedSchema.name = reader.getString(); + } else if ("content".equals(fieldName)) { + deserializedSchema.content = reader.getString(); + } else if ("direction".equals(fieldName)) { + deserializedSchema.direction = Direction.fromString(reader.getString()); + } else if ("schemaUri".equals(fieldName)) { + deserializedSchema.schemaUri = reader.getString(); + } else if ("schemaType".equals(fieldName)) { + deserializedSchema.schemaType = SchemaType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSchema; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SchemaStatus.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SchemaStatus.java new file mode 100644 index 000000000000..0d578007a6fd --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SchemaStatus.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the schema. + */ +public final class SchemaStatus extends ExpandableStringEnum { + /** + * Static value New for SchemaStatus. + */ + public static final SchemaStatus NEW = fromString("New"); + + /** + * Static value Approved for SchemaStatus. + */ + public static final SchemaStatus APPROVED = fromString("Approved"); + + /** + * Creates a new instance of SchemaStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SchemaStatus() { + } + + /** + * Creates or finds a SchemaStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SchemaStatus. + */ + public static SchemaStatus fromString(String name) { + return fromString(name, SchemaStatus.class); + } + + /** + * Gets known SchemaStatus values. + * + * @return known SchemaStatus values. + */ + public static Collection values() { + return values(SchemaStatus.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SchemaType.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SchemaType.java new file mode 100644 index 000000000000..f2dded6d27fb --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SchemaType.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The Schema Type. + */ +public final class SchemaType extends ExpandableStringEnum { + /** + * Static value Xsd for SchemaType. + */ + public static final SchemaType XSD = fromString("Xsd"); + + /** + * Static value Zip for SchemaType. + */ + public static final SchemaType ZIP = fromString("Zip"); + + /** + * Creates a new instance of SchemaType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SchemaType() { + } + + /** + * Creates or finds a SchemaType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SchemaType. + */ + public static SchemaType fromString(String name) { + return fromString(name, SchemaType.class); + } + + /** + * Gets known SchemaType values. + * + * @return known SchemaType values. + */ + public static Collection values() { + return values(SchemaType.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SchemasListResult.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SchemasListResult.java new file mode 100644 index 000000000000..f7eb1b9beeda --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SchemasListResult.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.azuredatatransfer.models; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.SchemasListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of SchemasListResult. + */ +public interface SchemasListResult { + /** + * Gets the value property: Schemas array. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.azuredatatransfer.fluent.models.SchemasListResultInner object. + * + * @return the inner object. + */ + SchemasListResultInner innerModel(); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SelectedResource.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SelectedResource.java new file mode 100644 index 000000000000..e33ee2ddf985 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SelectedResource.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A resource selected from ARM. + */ +@Fluent +public final class SelectedResource implements JsonSerializable { + /* + * Name of the connection + */ + private String name; + + /* + * Id of the connection + */ + private String id; + + /* + * Location of the connection + */ + private String location; + + /* + * Name of the subscription with the connection + */ + private String subscriptionName; + + /** + * Creates an instance of SelectedResource class. + */ + public SelectedResource() { + } + + /** + * Get the name property: Name of the connection. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the connection. + * + * @param name the name value to set. + * @return the SelectedResource object itself. + */ + public SelectedResource withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: Id of the connection. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of the connection. + * + * @param id the id value to set. + * @return the SelectedResource object itself. + */ + public SelectedResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the location property: Location of the connection. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Location of the connection. + * + * @param location the location value to set. + * @return the SelectedResource object itself. + */ + public SelectedResource withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the subscriptionName property: Name of the subscription with the connection. + * + * @return the subscriptionName value. + */ + public String subscriptionName() { + return this.subscriptionName; + } + + /** + * Set the subscriptionName property: Name of the subscription with the connection. + * + * @param subscriptionName the subscriptionName value to set. + * @return the SelectedResource object itself. + */ + public SelectedResource withSubscriptionName(String subscriptionName) { + this.subscriptionName = subscriptionName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model SelectedResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SelectedResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("subscriptionName", this.subscriptionName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SelectedResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SelectedResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SelectedResource. + */ + public static SelectedResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SelectedResource deserializedSelectedResource = new SelectedResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSelectedResource.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSelectedResource.name = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSelectedResource.location = reader.getString(); + } else if ("subscriptionName".equals(fieldName)) { + deserializedSelectedResource.subscriptionName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSelectedResource; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetDestinationEndpointPorts.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetDestinationEndpointPorts.java new file mode 100644 index 000000000000..bbe29a0b102c --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetDestinationEndpointPorts.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Set the destination endpoint ports for the specified stream ID. + */ +@Fluent +public final class SetDestinationEndpointPorts implements JsonSerializable { + /* + * The specified stream ID destination endpoint ports + */ + private List ports; + + /** + * Creates an instance of SetDestinationEndpointPorts class. + */ + public SetDestinationEndpointPorts() { + } + + /** + * Get the ports property: The specified stream ID destination endpoint ports. + * + * @return the ports value. + */ + public List ports() { + return this.ports; + } + + /** + * Set the ports property: The specified stream ID destination endpoint ports. + * + * @param ports the ports value to set. + * @return the SetDestinationEndpointPorts object itself. + */ + public SetDestinationEndpointPorts withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ports", this.ports, (writer, element) -> writer.writeLong(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SetDestinationEndpointPorts from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SetDestinationEndpointPorts if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SetDestinationEndpointPorts. + */ + public static SetDestinationEndpointPorts fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SetDestinationEndpointPorts deserializedSetDestinationEndpointPorts = new SetDestinationEndpointPorts(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ports".equals(fieldName)) { + List ports = reader.readArray(reader1 -> reader1.getLong()); + deserializedSetDestinationEndpointPorts.ports = ports; + } else { + reader.skipChildren(); + } + } + + return deserializedSetDestinationEndpointPorts; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetDestinationEndpoints.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetDestinationEndpoints.java new file mode 100644 index 000000000000..0576300a8c67 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetDestinationEndpoints.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Set the destination endpoints for the specified stream ID. + */ +@Fluent +public final class SetDestinationEndpoints implements JsonSerializable { + /* + * The specified stream ID destination endpoints + */ + private List endpoints; + + /** + * Creates an instance of SetDestinationEndpoints class. + */ + public SetDestinationEndpoints() { + } + + /** + * Get the endpoints property: The specified stream ID destination endpoints. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: The specified stream ID destination endpoints. + * + * @param endpoints the endpoints value to set. + * @return the SetDestinationEndpoints object itself. + */ + public SetDestinationEndpoints withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("endpoints", this.endpoints, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SetDestinationEndpoints from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SetDestinationEndpoints if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SetDestinationEndpoints. + */ + public static SetDestinationEndpoints fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SetDestinationEndpoints deserializedSetDestinationEndpoints = new SetDestinationEndpoints(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpoints".equals(fieldName)) { + List endpoints = reader.readArray(reader1 -> reader1.getString()); + deserializedSetDestinationEndpoints.endpoints = endpoints; + } else { + reader.skipChildren(); + } + } + + return deserializedSetDestinationEndpoints; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetSourceAddresses.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetSourceAddresses.java new file mode 100644 index 000000000000..03d365e2d419 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetSourceAddresses.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Set the source addresses for the specified stream ID. + */ +@Fluent +public final class SetSourceAddresses implements JsonSerializable { + /* + * Source addresses + */ + private List values; + + /** + * Creates an instance of SetSourceAddresses class. + */ + public SetSourceAddresses() { + } + + /** + * Get the values property: Source addresses. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: Source addresses. + * + * @param values the values value to set. + * @return the SetSourceAddresses object itself. + */ + public SetSourceAddresses withValues(List values) { + this.values = values; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SetSourceAddresses from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SetSourceAddresses if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SetSourceAddresses. + */ + public static SetSourceAddresses fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SetSourceAddresses deserializedSetSourceAddresses = new SetSourceAddresses(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getString()); + deserializedSetSourceAddresses.values = values; + } else { + reader.skipChildren(); + } + } + + return deserializedSetSourceAddresses; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetStreamPassphrase.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetStreamPassphrase.java new file mode 100644 index 000000000000..57464716c24c --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/SetStreamPassphrase.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Set the passphrase used for SRT streams. + */ +@Fluent +public final class SetStreamPassphrase implements JsonSerializable { + /* + * The passphrase used for SRT streams + */ + private String value; + + /** + * Creates an instance of SetStreamPassphrase class. + */ + public SetStreamPassphrase() { + } + + /** + * Get the value property: The passphrase used for SRT streams. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The passphrase used for SRT streams. + * + * @param value the value value to set. + * @return the SetStreamPassphrase object itself. + */ + public SetStreamPassphrase withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SetStreamPassphrase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SetStreamPassphrase if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SetStreamPassphrase. + */ + public static SetStreamPassphrase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SetStreamPassphrase deserializedSetStreamPassphrase = new SetStreamPassphrase(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedSetStreamPassphrase.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSetStreamPassphrase; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/StreamProtocol.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/StreamProtocol.java new file mode 100644 index 000000000000..d893177729fd --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/StreamProtocol.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The protocol of the stream. + */ +public final class StreamProtocol extends ExpandableStringEnum { + /** + * Static value UDP for StreamProtocol. + */ + public static final StreamProtocol UDP = fromString("UDP"); + + /** + * Static value SRT for StreamProtocol. + */ + public static final StreamProtocol SRT = fromString("SRT"); + + /** + * Static value RTP for StreamProtocol. + */ + public static final StreamProtocol RTP = fromString("RTP"); + + /** + * Creates a new instance of StreamProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StreamProtocol() { + } + + /** + * Creates or finds a StreamProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding StreamProtocol. + */ + public static StreamProtocol fromString(String name) { + return fromString(name, StreamProtocol.class); + } + + /** + * Gets known StreamProtocol values. + * + * @return known StreamProtocol values. + */ + public static Collection values() { + return values(StreamProtocol.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/StreamSourceAddresses.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/StreamSourceAddresses.java new file mode 100644 index 000000000000..6302e7959841 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/StreamSourceAddresses.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.azuredatatransfer.models; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.StreamSourceAddressesInner; +import java.util.List; + +/** + * An immutable client-side representation of StreamSourceAddresses. + */ +public interface StreamSourceAddresses { + /** + * Gets the sourceAddresses property: A source IP address or CIDR range. + * + * @return the sourceAddresses value. + */ + List sourceAddresses(); + + /** + * Gets the inner com.azure.resourcemanager.azuredatatransfer.fluent.models.StreamSourceAddressesInner object. + * + * @return the inner object. + */ + StreamSourceAddressesInner innerModel(); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Subscriber.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Subscriber.java new file mode 100644 index 000000000000..8d40020b9bff --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/Subscriber.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An individual that would like to subscribe to events that occur on a pipeline. + */ +@Fluent +public final class Subscriber implements JsonSerializable { + /* + * Email of the subscriber + */ + private String email; + + /* + * Number specifying what notifications to receive + */ + private Long notifications; + + /** + * Creates an instance of Subscriber class. + */ + public Subscriber() { + } + + /** + * Get the email property: Email of the subscriber. + * + * @return the email value. + */ + public String email() { + return this.email; + } + + /** + * Set the email property: Email of the subscriber. + * + * @param email the email value to set. + * @return the Subscriber object itself. + */ + public Subscriber withEmail(String email) { + this.email = email; + return this; + } + + /** + * Get the notifications property: Number specifying what notifications to receive. + * + * @return the notifications value. + */ + public Long notifications() { + return this.notifications; + } + + /** + * Set the notifications property: Number specifying what notifications to receive. + * + * @param notifications the notifications value to set. + * @return the Subscriber object itself. + */ + public Subscriber withNotifications(Long notifications) { + this.notifications = notifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("email", this.email); + jsonWriter.writeNumberField("notifications", this.notifications); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Subscriber from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Subscriber if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the Subscriber. + */ + public static Subscriber fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Subscriber deserializedSubscriber = new Subscriber(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("email".equals(fieldName)) { + deserializedSubscriber.email = reader.getString(); + } else if ("notifications".equals(fieldName)) { + deserializedSubscriber.notifications = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedSubscriber; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/TargetType.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/TargetType.java new file mode 100644 index 000000000000..15555859eb86 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/TargetType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of target to execute the action on. + */ +public final class TargetType extends ExpandableStringEnum { + /** + * Static value Pipeline for TargetType. + */ + public static final TargetType PIPELINE = fromString("Pipeline"); + + /** + * Static value Connection for TargetType. + */ + public static final TargetType CONNECTION = fromString("Connection"); + + /** + * Static value FlowType for TargetType. + */ + public static final TargetType FLOW_TYPE = fromString("FlowType"); + + /** + * Creates a new instance of TargetType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TargetType() { + } + + /** + * Creates or finds a TargetType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TargetType. + */ + public static TargetType fromString(String name) { + return fromString(name, TargetType.class); + } + + /** + * Gets known TargetType values. + * + * @return known TargetType values. + */ + public static Collection values() { + return values(TargetType.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/UserAssignedIdentity.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..1316161df452 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/UserAssignedIdentity.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.azuredatatransfer.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.UUID; + +/** + * User assigned identity properties. + */ +@Immutable +public final class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + private UUID clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ValidateSchemaResult.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ValidateSchemaResult.java new file mode 100644 index 000000000000..15b48aa75634 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ValidateSchemaResult.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.azuredatatransfer.models; + +import com.azure.resourcemanager.azuredatatransfer.fluent.models.ValidateSchemaResultInner; + +/** + * An immutable client-side representation of ValidateSchemaResult. + */ +public interface ValidateSchemaResult { + /** + * Gets the status property: Validation status of the schema. + * + * @return the status value. + */ + ValidateSchemaStatus status(); + + /** + * Gets the message property: Message describing the schema validation. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.azuredatatransfer.fluent.models.ValidateSchemaResultInner object. + * + * @return the inner object. + */ + ValidateSchemaResultInner innerModel(); +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ValidateSchemaStatus.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ValidateSchemaStatus.java new file mode 100644 index 000000000000..8a3c85a0ae06 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/ValidateSchemaStatus.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.azuredatatransfer.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Validation status of the schema. + */ +public final class ValidateSchemaStatus extends ExpandableStringEnum { + /** + * Static value Succeeded for ValidateSchemaStatus. + */ + public static final ValidateSchemaStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ValidateSchemaStatus. + */ + public static final ValidateSchemaStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of ValidateSchemaStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ValidateSchemaStatus() { + } + + /** + * Creates or finds a ValidateSchemaStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ValidateSchemaStatus. + */ + public static ValidateSchemaStatus fromString(String name) { + return fromString(name, ValidateSchemaStatus.class); + } + + /** + * Gets known ValidateSchemaStatus values. + * + * @return known ValidateSchemaStatus values. + */ + public static Collection values() { + return values(ValidateSchemaStatus.class); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/package-info.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/package-info.java new file mode 100644 index 000000000000..69c62c2357e1 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for Azuredatatransferrp. + * Azure Data Transfer service resource provider. + */ +package com.azure.resourcemanager.azuredatatransfer.models; diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/package-info.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/package-info.java new file mode 100644 index 000000000000..7142a7f32692 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/com/azure/resourcemanager/azuredatatransfer/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for Azuredatatransferrp. + * Azure Data Transfer service resource provider. + */ +package com.azure.resourcemanager.azuredatatransfer; diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/module-info.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/module-info.java new file mode 100644 index 000000000000..641d84254316 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/java/module-info.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.azuredatatransfer { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.azuredatatransfer; + exports com.azure.resourcemanager.azuredatatransfer.fluent; + exports com.azure.resourcemanager.azuredatatransfer.fluent.models; + exports com.azure.resourcemanager.azuredatatransfer.models; + + opens com.azure.resourcemanager.azuredatatransfer.fluent.models to com.azure.core; + opens com.azure.resourcemanager.azuredatatransfer.models to com.azure.core; +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azuredatatransfer/proxy-config.json b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azuredatatransfer/proxy-config.json new file mode 100644 index 000000000000..7ed481405991 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azuredatatransfer/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.azuredatatransfer.implementation.AzureDataTransfersClientImpl$AzureDataTransfersService"],["com.azure.resourcemanager.azuredatatransfer.implementation.ConnectionsClientImpl$ConnectionsService"],["com.azure.resourcemanager.azuredatatransfer.implementation.FlowsClientImpl$FlowsService"],["com.azure.resourcemanager.azuredatatransfer.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.azuredatatransfer.implementation.PipelinesClientImpl$PipelinesService"]] \ No newline at end of file diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azuredatatransfer/reflect-config.json b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azuredatatransfer/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-azuredatatransfer/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/resources/azure-resourcemanager-azuredatatransfer.properties b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/resources/azure-resourcemanager-azuredatatransfer.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/main/resources/azure-resourcemanager-azuredatatransfer.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsCreateOrUpdateSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..0887ed933cc9 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsCreateOrUpdateSamples.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.azuredatatransfer.generated; + +/** + * Samples for Connections CreateOrUpdate. + */ +public final class ConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * createOrUpdateConnection.json + */ + /** + * Sample code: Creates or updates the connection resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void createsOrUpdatesTheConnectionResource( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.connections() + .define("testConnection") + .withRegion((String) null) + .withExistingResourceGroup("testRG") + .create(); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsDeleteSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsDeleteSamples.java new file mode 100644 index 000000000000..701550cd7581 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsDeleteSamples.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.azuredatatransfer.generated; + +/** + * Samples for Connections Delete. + */ +public final class ConnectionsDeleteSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * deleteConnection.json + */ + /** + * Sample code: Deletes the connection resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + deletesTheConnectionResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.connections().delete("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsGetByResourceGroupSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..522ce0114a91 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsGetByResourceGroupSamples.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.azuredatatransfer.generated; + +/** + * Samples for Connections GetByResourceGroup. + */ +public final class ConnectionsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * getConnection.json + */ + /** + * Sample code: Gets connection resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getsConnectionResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.connections() + .getByResourceGroupWithResponse("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsLinkSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsLinkSamples.java new file mode 100644 index 000000000000..8f1d9fa5ba5a --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsLinkSamples.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.azuredatatransfer.generated; + +/** + * Samples for Connections Link. + */ +public final class ConnectionsLinkSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * linkConnection.json + */ + /** + * Sample code: Links the specified connection. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + linksTheSpecifiedConnection(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.connections().link("testRG", "testConnection", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsListByResourceGroupSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..6b12d3982d62 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsListByResourceGroupSamples.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.azuredatatransfer.generated; + +/** + * Samples for Connections ListByResourceGroup. + */ +public final class ConnectionsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * listConnectionsByResourceGroup.json + */ + /** + * Sample code: Gets connections in a resource group. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getsConnectionsInAResourceGroup(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.connections().listByResourceGroup("testRG", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsListBySubscriptionSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsListBySubscriptionSamples.java new file mode 100644 index 000000000000..0402027d625d --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsListBySubscriptionSamples.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.azuredatatransfer.generated; + +/** + * Samples for Connections ListBySubscription. + */ +public final class ConnectionsListBySubscriptionSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * listConnectionsBySubscription.json + */ + /** + * Sample code: Gets connections in a subscription. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getsConnectionsInASubscription(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.connections().listBySubscription(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsUpdateSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsUpdateSamples.java new file mode 100644 index 000000000000..cd74331894cc --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/ConnectionsUpdateSamples.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.azuredatatransfer.generated; + +import com.azure.resourcemanager.azuredatatransfer.models.Connection; + +/** + * Samples for Connections Update. + */ +public final class ConnectionsUpdateSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * patchConnection.json + */ + /** + * Sample code: Updates the connection resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + updatesTheConnectionResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + Connection resource = manager.connections() + .getByResourceGroupWithResponse("testRG", "testConnection", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsCreateOrUpdateSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..f93370dd6b33 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsCreateOrUpdateSamples.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.azuredatatransfer.generated; + +/** + * Samples for Flows CreateOrUpdate. + */ +public final class FlowsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * createOrUpdateFlow.json + */ + /** + * Sample code: Creates or updates the flow resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + createsOrUpdatesTheFlowResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .define("testFlow") + .withRegion((String) null) + .withExistingConnection("testRG", "testConnection") + .create(); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsDeleteSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsDeleteSamples.java new file mode 100644 index 000000000000..5ba199bbc2a1 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsDeleteSamples.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.azuredatatransfer.generated; + +/** + * Samples for Flows Delete. + */ +public final class FlowsDeleteSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * deleteFlow.json + */ + /** + * Sample code: Deletes the flow resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + deletesTheFlowResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows().delete("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsEnableSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsEnableSamples.java new file mode 100644 index 000000000000..a1fbd5d3c85b --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsEnableSamples.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.azuredatatransfer.generated; + +/** + * Samples for Flows Enable. + */ +public final class FlowsEnableSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * enableOrDisableFlow.json + */ + /** + * Sample code: Enables the specified flow. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + enablesTheSpecifiedFlow(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows().enable("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGeneratePassphraseSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGeneratePassphraseSamples.java new file mode 100644 index 000000000000..75f3ee314f81 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGeneratePassphraseSamples.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.azuredatatransfer.generated; + +/** + * Samples for Flows GeneratePassphrase. + */ +public final class FlowsGeneratePassphraseSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * generateFlowPassphrase.json + */ + /** + * Sample code: Generate a new compliant streaming passphrase. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void generateANewCompliantStreamingPassphrase( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows().generatePassphrase("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetDestinationEndpointPortsSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetDestinationEndpointPortsSamples.java new file mode 100644 index 000000000000..517e7a45db6c --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetDestinationEndpointPortsSamples.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.azuredatatransfer.generated; + +/** + * Samples for Flows GetDestinationEndpointPorts. + */ +public final class FlowsGetDestinationEndpointPortsSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * getFlowDestinationEndpointPorts.json + */ + /** + * Sample code: Get the flow stream destination endpoint ports. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void getTheFlowStreamDestinationEndpointPorts( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .getDestinationEndpointPortsWithResponse("testRG", "testConnection", "testFlow", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetDestinationEndpointsSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetDestinationEndpointsSamples.java new file mode 100644 index 000000000000..3a5ba67c480a --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetDestinationEndpointsSamples.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.azuredatatransfer.generated; + +/** + * Samples for Flows GetDestinationEndpoints. + */ +public final class FlowsGetDestinationEndpointsSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * getFlowDestinationEndpoints.json + */ + /** + * Sample code: Get the flow stream destination endpoints. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void getTheFlowStreamDestinationEndpoints( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .getDestinationEndpointsWithResponse("testRG", "testConnection", "testFlow", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetSamples.java new file mode 100644 index 000000000000..81af575ec97d --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetSamples.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.azuredatatransfer.generated; + +/** + * Samples for Flows Get. + */ +public final class FlowsGetSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * getFlow.json + */ + /** + * Sample code: Gets flow resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void getsFlowResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows().getWithResponse("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetSourceAddressesSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetSourceAddressesSamples.java new file mode 100644 index 000000000000..379b29f1f717 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetSourceAddressesSamples.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.azuredatatransfer.generated; + +/** + * Samples for Flows GetSourceAddresses. + */ +public final class FlowsGetSourceAddressesSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * getFlowSourceAddresses.json + */ + /** + * Sample code: Get the flow stream source addresses. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getTheFlowStreamSourceAddresses(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .getSourceAddressesWithResponse("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetStreamConnectionStringSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetStreamConnectionStringSamples.java new file mode 100644 index 000000000000..7053e5493a7c --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsGetStreamConnectionStringSamples.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.azuredatatransfer.generated; + +/** + * Samples for Flows GetStreamConnectionString. + */ +public final class FlowsGetStreamConnectionStringSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * getStreamConnectionString.json + */ + /** + * Sample code: Get the flow stream connection string. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getTheFlowStreamConnectionString(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .getStreamConnectionStringWithResponse("testRG", "testConnection", "testFlow", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsLinkSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsLinkSamples.java new file mode 100644 index 000000000000..d984a7e5ef93 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsLinkSamples.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.azuredatatransfer.generated; + +/** + * Samples for Flows Link. + */ +public final class FlowsLinkSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * linkFlow.json + */ + /** + * Sample code: Links the specified flow. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + linksTheSpecifiedFlow(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows().link("testRG", "testConnection", "testFlow", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsListByConnectionSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsListByConnectionSamples.java new file mode 100644 index 000000000000..29bcf47cba4f --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsListByConnectionSamples.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.azuredatatransfer.generated; + +/** + * Samples for Flows ListByConnection. + */ +public final class FlowsListByConnectionSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * listFlowsByConnection.json + */ + /** + * Sample code: Gets flows in a connection. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getsFlowsInAConnection(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows().listByConnection("testRG", "testConnection", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetDestinationEndpointPortsSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetDestinationEndpointPortsSamples.java new file mode 100644 index 000000000000..7488f716a8f0 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetDestinationEndpointPortsSamples.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.azuredatatransfer.generated; + +/** + * Samples for Flows SetDestinationEndpointPorts. + */ +public final class FlowsSetDestinationEndpointPortsSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * setFlowDestinationEndpointPorts.json + */ + /** + * Sample code: Set the flow stream destination endpoint ports. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void setTheFlowStreamDestinationEndpointPorts( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .setDestinationEndpointPorts("testRG", "testConnection", "testFlow", null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetDestinationEndpointsSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetDestinationEndpointsSamples.java new file mode 100644 index 000000000000..12c40569f4bb --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetDestinationEndpointsSamples.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.azuredatatransfer.generated; + +/** + * Samples for Flows SetDestinationEndpoints. + */ +public final class FlowsSetDestinationEndpointsSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * setFlowDestinationEndpoints.json + */ + /** + * Sample code: Set the flow stream destination endpoints. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void setTheFlowStreamDestinationEndpoints( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .setDestinationEndpoints("testRG", "testConnection", "testFlow", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetPassphraseSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetPassphraseSamples.java new file mode 100644 index 000000000000..21af05e0c9ab --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetPassphraseSamples.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.azuredatatransfer.generated; + +/** + * Samples for Flows SetPassphrase. + */ +public final class FlowsSetPassphraseSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * setFlowPassphrase.json + */ + /** + * Sample code: Set the flow stream passphrase. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + setTheFlowStreamPassphrase(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows().setPassphrase("testRG", "testConnection", "testFlow", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetSourceAddressesSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetSourceAddressesSamples.java new file mode 100644 index 000000000000..07ff8afc9757 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsSetSourceAddressesSamples.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.azuredatatransfer.generated; + +/** + * Samples for Flows SetSourceAddresses. + */ +public final class FlowsSetSourceAddressesSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * setFlowSourceAddresses.json + */ + /** + * Sample code: Set the flow stream source addresses. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + setTheFlowStreamSourceAddresses(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.flows() + .setSourceAddresses("testRG", "testConnection", "testFlow", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsUpdateSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsUpdateSamples.java new file mode 100644 index 000000000000..f781a3d67f33 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/FlowsUpdateSamples.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.azuredatatransfer.generated; + +import com.azure.resourcemanager.azuredatatransfer.models.Flow; + +/** + * Samples for Flows Update. + */ +public final class FlowsUpdateSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * patchFlow.json + */ + /** + * Sample code: Updates the flow resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + updatesTheFlowResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + Flow resource = manager.flows() + .getWithResponse("testRG", "testConnection", "testFlow", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/OperationsListSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/OperationsListSamples.java new file mode 100644 index 000000000000..d87f3057efa1 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/OperationsListSamples.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.azuredatatransfer.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * listOperations.json + */ + /** + * Sample code: List operations. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void listOperations(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesCreateOrUpdateSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..2a903731488d --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesCreateOrUpdateSamples.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.azuredatatransfer.generated; + +/** + * Samples for Pipelines CreateOrUpdate. + */ +public final class PipelinesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * createOrUpdatePipeline.json + */ + /** + * Sample code: Creates or updates the pipeline resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void createsOrUpdatesThePipelineResource( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.pipelines() + .define("testPipeline") + .withRegion((String) null) + .withExistingResourceGroup("testRG") + .create(); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesDeleteSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesDeleteSamples.java new file mode 100644 index 000000000000..437b486a6776 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesDeleteSamples.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.azuredatatransfer.generated; + +/** + * Samples for Pipelines Delete. + */ +public final class PipelinesDeleteSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * deletePipeline.json + */ + /** + * Sample code: Deletes the pipeline resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + deletesThePipelineResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.pipelines().delete("testRG", "testPipeline", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesExecuteActionSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesExecuteActionSamples.java new file mode 100644 index 000000000000..cb8ddbbae568 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesExecuteActionSamples.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.azuredatatransfer.generated; + +/** + * Samples for Pipelines ExecuteAction. + */ +public final class PipelinesExecuteActionSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * executeAction.json + */ + /** + * Sample code: Executes action for a pipeline. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + executesActionForAPipeline(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.pipelines().executeAction("testRG", "testPipeline", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesGetByResourceGroupSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..a47669685a1a --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesGetByResourceGroupSamples.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.azuredatatransfer.generated; + +/** + * Samples for Pipelines GetByResourceGroup. + */ +public final class PipelinesGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * getPipeline.json + */ + /** + * Sample code: Gets pipeline resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getsPipelineResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.pipelines().getByResourceGroupWithResponse("testRG", "testPipeline", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesListByResourceGroupSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesListByResourceGroupSamples.java new file mode 100644 index 000000000000..62a1ea2fda7a --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesListByResourceGroupSamples.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.azuredatatransfer.generated; + +/** + * Samples for Pipelines ListByResourceGroup. + */ +public final class PipelinesListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * listPipelinesByResourceGroup.json + */ + /** + * Sample code: Gets pipelines in a resource group. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getsPipelinesInAResourceGroup(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.pipelines().listByResourceGroup("testRG", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesListBySubscriptionSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesListBySubscriptionSamples.java new file mode 100644 index 000000000000..d1b023848097 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesListBySubscriptionSamples.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.azuredatatransfer.generated; + +/** + * Samples for Pipelines ListBySubscription. + */ +public final class PipelinesListBySubscriptionSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * listPipelinesBySubscription.json + */ + /** + * Sample code: Gets pipelines in a subscription. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + getsPipelinesInASubscription(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.pipelines().listBySubscription(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesRejectConnectionSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesRejectConnectionSamples.java new file mode 100644 index 000000000000..93b464452a9c --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesRejectConnectionSamples.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.azuredatatransfer.generated; + +/** + * Samples for Pipelines RejectConnection. + */ +public final class PipelinesRejectConnectionSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * approveOrRejectConnection.json + */ + /** + * Sample code: Rejects the specified connection in a pipeline. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void rejectsTheSpecifiedConnectionInAPipeline( + com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + manager.pipelines().rejectConnection("testRG", "testPipeline", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesUpdateSamples.java b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesUpdateSamples.java new file mode 100644 index 000000000000..351f62031266 --- /dev/null +++ b/sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/src/samples/java/com/azure/resourcemanager/azuredatatransfer/generated/PipelinesUpdateSamples.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.azuredatatransfer.generated; + +import com.azure.resourcemanager.azuredatatransfer.models.Pipeline; + +/** + * Samples for Pipelines Update. + */ +public final class PipelinesUpdateSamples { + /* + * x-ms-original-file: + * specification/azuredatatransfer/resource-manager/Microsoft.AzureDataTransfer/preview/2025-04-11-preview/examples/ + * patchPipeline.json + */ + /** + * Sample code: Updates the pipeline resource. + * + * @param manager Entry point to AzuredatatransferManager. + */ + public static void + updatesThePipelineResource(com.azure.resourcemanager.azuredatatransfer.AzuredatatransferManager manager) { + Pipeline resource = manager.pipelines() + .getByResourceGroupWithResponse("testRG", "testPipeline", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } +} diff --git a/sdk/azuredatatransfer/ci.yml b/sdk/azuredatatransfer/ci.yml new file mode 100644 index 000000000000..5dd6d542426c --- /dev/null +++ b/sdk/azuredatatransfer/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/azuredatatransfer/ci.yml + - sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/ + exclude: + - sdk/azuredatatransfer/pom.xml + - sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azuredatatransfer/ci.yml + - sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/ + exclude: + - sdk/azuredatatransfer/pom.xml + - sdk/azuredatatransfer/azure-resourcemanager-azuredatatransfer/pom.xml + +parameters: + - name: release_azureresourcemanagerazuredatatransfer + displayName: azure-resourcemanager-azuredatatransfer + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: azuredatatransfer + Artifacts: + - name: azure-resourcemanager-azuredatatransfer + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerazuredatatransfer + releaseInBatch: ${{ parameters.release_azureresourcemanagerazuredatatransfer }} diff --git a/sdk/azuredatatransfer/pom.xml b/sdk/azuredatatransfer/pom.xml new file mode 100644 index 000000000000..7e24cff9c79a --- /dev/null +++ b/sdk/azuredatatransfer/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-azuredatatransfer-service + pom + 1.0.0 + + + azure-resourcemanager-azuredatatransfer + +